AKS Cluster
How to Optimize Azure Managed Kubernetes Clusters (AKS)
1. Download Kaytu CLI
MacOS
brew tap kaytu-io/cli-tap && brew install kaytuLinux
curl -fsSL https://raw.githubusercontent.com/kaytu-io/kaytu/main/scripts/install.sh | shWindows (and all Binaries) Download Windows (Linux, and MacOS) binary from releases
2. Login to kaytu CLI
kaytu loginInstall the Kaytu CLI plugin
kaytu plugin install kubernetes3. Login to Azure CLI
If you don't have AWS CLI, go here and install it.
Run to confirm you are logged in to the correct account
az login4. Authenticate to Kubernetes Cluster
az aks get-credentials -g ${RESOURCE_GROUP_NAME} -n ${AKS_NAME}Replace Resource Group Name and ASK Name.
Get the Kubeconfig
kubelogin convert-kubeconfig -l azurecliTo confirm you are connected to the cluster:
kubectl get nodes5. Install Kubernetes Agent
5a. Generate Enrollment Keys
Enrollment keys allow the Kubernetes cluster to get optimization results from the Kaytu platform.
kaytu apikey generate [cluster-name]Replace Cluster name with the Kubernetes Cluster.
Please copy the enrollment key provided. Unfortunately, you won't be able to view the key at a later time.
5b. Add Helm Repo
helm repo add kaytu-io https://kaytu-io.github.io/kaytu-chartsOnce that completes, we can run update Charts:
helm repo update5c. Populate the values.yaml
In values.yaml file, please make sure the following variables are correctly configured:
kaytu.kaytu.authToken needs to be populated with the key generated in Step 4.
kaytu.kaytu.prometheus.address needs to be pointed to the Prometheus endpoint.
5d. Install the Chart
This will create a namespace if one doesn't exist for Kaytu
helm install --create-namespace -n kaytu-system my-kaytu-agent kaytu-io/kaytu-agent -f values.yaml5e. Wait for optimization
Check the logs and wait for the optimization cycle to be over
kubectl logs -f kaytu-agent-0Wait for the log containing the optimization cycle to be completed.
6. Run optimization Checks
kaytu optimize kubernetes