Deploy Cluster Autoscaler¶
This section will guide you through deploying the Cluster Autoscaler on your EKS cluster.
Fast Forward
If you already have deployed the Cluster Autoscaler, expand this box to fast-forward.
Go to your GitOps repository, inside your
rok-toolsmanagement environment:root@rok-tools:~# cd ~/ops/deploymentsSave your state:
root@rok-tools:~/ops/deployments# rok-j2 deploy/env.autoscaler-eks-deploy.j2 \ > -o deploy/env.autoscaler-eks-deployCommit your changes:
root@rok-tools:~/ops/deployments# git commit -am "Deploy Cluster Autoscaler"Proceed to the Verify section.
See also
- Official EKS docs for Cluster Autoscaler.
Warning
Only use Cluster Autoscaler images provided by Arrikto for these manifests. Generic Cluster Autoscaler images are not compatible with these manifests.
Choose one of the following options to deploy the Cluster Autoscaler:
- Option 1: Deploy Cluster Autoscaler Automatically (preferred).
- Option 2: Deploy Cluster Autoscaler Manually.
Overview
What You’ll Need¶
- A configured management environment.
- Your clone of the Arrikto GitOps repository.
- An existing EKS cluster.
- An existing IAM role for the Cluster Autoscaler.
Option 1: Deploy Cluster Autoscaler Automatically (preferred)¶
Deploy the Cluster Autoscaler by following the on-screen instructions on the
rok-deploy user interface.
If rok-deploy is not already running, start it with:
Proceed to the Summary section.
Option 2: Deploy Cluster Autoscaler Manually¶
If you want to deploy the Cluster Autoscaler manually, follow the instructions below.
Procedure¶
Go to your GitOps repository, inside your
rok-toolsmanagement environment:root@rok-tools:~# cd ~/ops/deploymentsRestore the required context from previous sections:
root@rok-tools:~/ops/deployments# source <(cat deploy/env.{envvars-aws,\ > eks-cluster,autoscaler-eks-iam})root@rok-tools:~/ops/deployments# export EKS_CLUSTER AWS_ACCOUNT_ID AUTOSCALER_EKS_IAM_ROLERender the Cluster Autoscaler service account patch template with the variables you have specified:
root@rok-tools:~/ops/deployments# j2 rok/cluster-autoscaler/overlays/deploy/patches/sa.yaml.j2 \ > -o rok/cluster-autoscaler/overlays/deploy/patches/sa.yamlRender the
params.envtemplate with the values you have specified:root@rok-tools:~/ops/deployments# j2 rok/cluster-autoscaler/overlays/deploy/params.env.j2 \ > -o rok/cluster-autoscaler/overlays/deploy/params.envAdd the Cluster Autoscaler overlay that corresponds to your Kubernetes version. Choose one of the following options, based on your Kubernetes version:
Edit
rok/cluster-autoscaler/overlays/deploy/kustomization.yamland usek8s-1.23instead ofarriktoas the base overlay:resources: #- ../arrikto ... #- ../k8s-1.22 - ../k8s-1.23
Edit
rok/cluster-autoscaler/overlays/deploy/kustomization.yamland usek8s-1.22instead ofarriktoas the base overlay:resources: #- ../arrikto ... - ../k8s-1.22 #- ../k8s-1.23
Edit
rok/cluster-autoscaler/overlays/deploy/kustomization.yamland usek8s-1.21instead ofarriktoas the base overlay:resources: #- ../arrikto ... - ../k8s-1.21 #- ../k8s-1.22 #- ../k8s-1.23
Air Gapped
Patch the kustomization to use the mirrored images:
root@rok-tools:/# rok-image-patch \ > --kustomizations ~/ops/deployments/rok/cluster-autoscaler/overlays/deployfollow the on-screen instructions and provide any necessary input.
Save your state:
root@rok-tools:~/ops/deployments# rok-j2 deploy/env.autoscaler-eks-deploy.j2 \ > -o deploy/env.autoscaler-eks-deployCommit your changes:
root@rok-tools:~/ops/deployments# git commit -am "Deploy Cluster Autoscaler"Apply the kustomization:
root@rok-tools:~/ops/deployments# rok-deploy --apply rok/cluster-autoscaler/overlays/deployMark 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?}/release-2.0/autoscaler-eks-deploy \ > -m "Deploy Cluster Autoscaler"