![]() First, configure the Kubernetes and Helm providers. Let's take a look at the Helm module first. The Terraform configuration for both examples is available in this repository. ![]() To make these benefits less abstract, let's compare my Nginx ingress module with one using the Helm provider to provision Nginx ingress. Each Kubernetes resource is tracked individually in Terraform state, so diffs and plans show the changes to the actual Kubernetes resources.By defining the Kustomize overlay in HCL, all Kubernetes resources are fully customizable using values from Terraform.Like Kustomize, the upstream YAML is left untouched, meaning upstream updates require minimal maintenance effort.I believe my Kustomization provider based modules are a better alternative because of three distinct benefits: These two use native YAML instead of HCL, but do not integrate the Kubernetes resources into the Terraform state and, as a consequence, lifecycle. On the other hand, there are the Helm provider and the Kubectl provider. Especially for Kubernetes YAML you consume from upstream. And while it integrates Kubernetes resources into Terraform, maintaining the Kubernetes resources in HCL is a lot of effort. On the one hand, there's the Kubernetes provider. And unified provisioning of all platform components, from cluster infrastructure to cluster services, is something I consider crucial in my relentless pursuit of said developer experience.īecause of that, the two common approaches to provision Kubernetes resources using Terraform never really appealed to me. With Kubestack, the open-source Terraform framework I maintain, I'm on a mission to provide the best developer experience for teams working with Terraform and Kubernetes. ![]() ![]() But despite Kubernetes' own declarative API, and the obvious benefits of maintaining a cluster's infrastructure and services from the same infrastructure as code repository, Terraform is far from the first choice to provision Kubernetes resources. Think of ingress controllers or logging and monitoring agents and so on. And as a platform to build platforms, Kubernetes commonly requires a number of additional services before workloads can be deployed. In combination with a declarative API, like a cloud provider API, it can determine, preview, and apply changes to the codified infrastructure.Ĭonsequently, it is common for teams to use Terraform to define the infrastructure of their Kubernetes clusters. Terraform is immensely powerful when it comes to defining and maintaining infrastructure as code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |