Configure Cluster Autoscaler for your Kubernetes Version¶
This guide will walk you through configuring the Cluster Autoscaler after you have upgraded your control plane.
Note
This guide assumes that you have already deployed the Cluster Autoscaler on your cluster. If this does not hold, please proceed to the corresponding guide for deploying the Cluster Autoscaler on your cluster.
What You’ll Need¶
- A configured management environment.
- Your clone of the Arrikto GitOps repository.
- An existing EKS cluster.
- A working Cluster Autoscaler.
Check Your Environment¶
Get the version of the Kubernetes control plane. Choose one of the following options, based on the upgrade you performed:
root@rok-tools:~# kubectl version -ojson | jq -r '.serverVersion.gitVersion' v1.24.14-eks-fb459a0This guide presumes that you have upgraded your control plane to Kubernetes 1.24. The output of the above command must start with
v1.24
. If it does not, your control plane does not have the expected Kubernetes version. Please upgrade your control plane before proceeding.root@rok-tools:~# kubectl version -ojson | jq -r '.serverVersion.gitVersion' v1.23.13-eks-fb459a0This guide presumes that you have upgraded your control plane to Kubernetes 1.23. The output of the above command must start with
v1.23
. If it does not, your control plane does not have the expected Kubernetes version. Please upgrade your control plane before proceeding.
Procedure¶
Go to your GitOps repository, inside your
rok-tools
management environment:root@rok-tools:~# cd ~/ops/deploymentsUse the Cluster Autoscaler manifests for the
eks
platform:root@rok-tools:~/ops/deployments# export PLATFORM=eksEnable the Cluster Autoscaler component that corresponds to your Kubernetes version. Choose one of the following options, based on the upgrade you’ve made:
Set the Kubernetes cluster version to
1.24
:root@rok-tools:~/ops/deployments# export CLUSTER_VERSION=1.24
Set the Kubernetes cluster version to
1.23
:root@rok-tools:~/ops/deployments# export CLUSTER_VERSION=1.23
Configure the
deploy
overlay to use the necessary platform overlay and components:root@rok-tools:~/ops/deployments# j2 \ > rok/cluster-autoscaler/overlays/deploy/kustomization.yaml.j2 \ > -o rok/cluster-autoscaler/overlays/deploy/kustomization.yamlAir Gapped
Patch the kustomization to use the mirrored images:
root@rok-tools:~/ops/deployments# rok-image-patch \ > --kustomizations rok/cluster-autoscaler/overlays/deployFollow the on-screen instructions and provide any necessary input.
Commit your changes. Choose one of the following options, based on the upgrade you performed:
root@rok-tools:~/ops/deployments# git commit -am "Configure Cluster Autoscaler for Kubernetes 1.24"root@rok-tools:~/ops/deployments# git commit -am "Configure Cluster Autoscaler for Kubernetes 1.23"Mark your progress:
root@rok-tools:~/ops/deployments# export DATE=$(date -u "+%Y-%m-%dT%H.%M.%SZ")root@rok-tools:~/ops/deployments# git tag \ > -a deploy/${DATE?}/develop/ops-eks-upgrade-autoscaler \ > -m "Configure Cluster Autoscaler for your Kubernetes Version"Apply the kustomization:
root@rok-tools:~/ops/deployments# rok-deploy --apply rok/cluster-autoscaler/overlays/deploy
Verify¶
Verify that the Cluster Autoscaler is up and running. Verify that field READY is 1/1:
root@rok-tools:~# kubectl get -n kube-system deploy/cluster-autoscaler NAME READY UP-TO-DATE AVAILABLE AGE cluster-autoscaler 1/1 1 1 1mGet the image of the Cluster Autoscaler. Choose one of the following options, based on the upgrade you performed:
Ensure that the image tag matches the Kubernetes version 1.23, that is, it starts with
1.23
:root@rok-tools:~# kubectl -n kube-system get deploy cluster-autoscaler \ > -o jsonpath='{.spec.template.spec.containers[].image}{"\n"}' gcr.io/arrikto/cluster-autoscaler-amd64:1.23.0-37-gf63d1db8cEnsure that the image tag matches the Kubernetes version 1.22, that is, it starts with
1.22
:root@rok-tools:~# kubectl -n kube-system get deploy cluster-autoscaler \ > -o jsonpath='{.spec.template.spec.containers[].image}{"\n"}' gcr.io/arrikto/cluster-autoscaler-amd64:1.22.2-35-ge100ed649
What’s Next¶
Check out the rest of the EKS maintenance operations that you can perform on your cluster.