The Kubernetes (K8S) provider is used to interact with the resources supported by Kubernetes. The provider needs to be configured with the proper credentials before it can be used. Both backward and forward compatibility with Kubernetes API is mostly defined by the official K8S Go library (prior to 1.1 release) and client Go library which we ship with Terraform. Terraform providers for various cloud providers feature resources to spin up managed Kubernetes clusters on services such as EKS, AKS, and GKE. Such resources (or data sources) will have attributes that expose the credentials needed for the Kubernetes provider to connect to these clusters. To use these credentials with the Kubernetes provider, they can be interpolated into the respective attributes of the Kubernetes provider configuration block. The most reliable way to configure the Kubernetes provider is to ensure that the cluster itself and the Kubernetes provider resources can be managed with separate apply operations.
Features
- Stacking with managed Kubernetes cluster resources
- Documentation available
- Examples available
- The Kubernetes provider can get its configuration in two ways
- Supply attributes to the provider block
- You can also configure the host, basic auth credentials, and client certificate authentication explicitly or through environment variables