This Terraform Module will upgrade the Kubernetes Version of your AKS default node pool.
- Terraform 0.14.5
- AzureRM Provider 2.45.0
On Medium
The authentication must be setup for a Service Principal with the ARM_*** environment variables.
Find the documentation here
$ export ARM_CLIENT_ID="00000000-0000-0000-0000-000000000000"
$ export ARM_CLIENT_SECRET="00000000-0000-0000-0000-000000000000"
$ export ARM_SUBSCRIPTION_ID="00000000-0000-0000-0000-000000000000"
$ export ARM_TENANT_ID="00000000-0000-0000-0000-000000000000"
Depending on the used Linux distribution and its SELinux configuration
you must adjust the volume mounts and/or the user to run the container as.
# with docker
alias terraform='docker run --env-file <(env | grep -v PATH) -it --rm -v $PWD:$PWD:rw,Z -w $PWD ghcr.io/300481/terraform:0.14.5'
# with podman
alias terraform='podman run --env-file <(env | grep -v PATH) -it --rm -v $PWD:$PWD:rw,Z -w $PWD ghcr.io/300481/terraform:0.14.5'
Name | Version |
---|---|
external | n/a |
null | n/a |
Name | Description | Type | Default | Required |
---|---|---|---|---|
default_pool_name | The name of the default node pool. | string |
n/a | yes |
kubernetes_cluster_name | The name of the Kubernetes Cluster. | string |
n/a | yes |
resource_group_name | The name of the Resource Group which contains the Kubernetes Cluster. | string |
n/a | yes |
kubernetes_node_version | The Kubernetes Version for the default node pool. | string |
"empty" |
no |
No output.
resource "azurerm_kubernetes_cluster" "kubernetes_cluster" {
...
# your cluster definition
...
}
module "aks-default-node-pool-upgrader" {
source = "300481/aks-default-node-pool-upgrader/azurerm"
version = "0.0.5"
default_pool_name = "default"
kubernetes_cluster_name = azurerm_kubernetes_cluster.kubernetes_cluster.name
resource_group_name = "The_RG_of_your_cluster"
kubernetes_node_version = "1.19.3"
}
Your Cluster must be created before using this module.
This can be achieved using the name attribute of your cluster resource or
the depends_on argument filled with the kubernetes_cluster resource.
Following Linux packages are needed:
-
jq
-
curl
When using the container image ghcr.io/300481/terraform
they are already included.