DevOps | Cloud | Analytics | Open Source | Programming





How To Update Kubernetes Version in AWS EKS Cluster ?



In this post, we will see How To Update Kubernetes Version in AWS EKS Cluster.

  • You launch AWS EKS new API server nodes with the updated Kubernetes version
  • This replaces the existing ones.
  • If AWS EKS sanity checks fails, the previous Kubernetes version stays back.

Pre Steps:

Firstly install or check "eksctl" - use the latest version.


##MAC
brew tap weaveworks/tap
brew install weaveworks/tap/eksctl
brew upgrade eksctl && brew link --overwrite eksctl
eksctl version


#Windows
choco install -y eksctl
choco upgrade -y eksctl
eksctl version


\# Linux
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl\_$(uname -s)\_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin

eksctl version

 

Solution:

Follow the steps below -

  • Check current Kubernetes version

kubectl version --short

  • Check current version of your nodes (self-managed\managed AWS EC2 and Fargate nodes)

kubectl get nodes

  • Ensure the versions in the nodes are in sync and compatible or preferably same.
 

  • Check the pod policy

kubectl get psp eks.privileged

 

  • Update cluster

eksctl upgrade cluster --name my-cluster --approve

OR Through AWS EKS Console. Choose Update cluster version. Select Kubernetes version and choose Update & Confirm. OR Through AWS CLI


aws eks update-cluster-version \\
 --region region-code \\ 
--name eks-cluster \\ 
--kubernetes-version x.yz


aws eks describe-update \\
 --region region-code \\
 --name eks-cluster \\
 --update-id <UPDATE ID FROM ABOVE PREVIOUS COMMAND EXECUTION>

 

  • Update the nodes to also the same Kubernetes version.
    Hope this helps.  

Additional Posts you might want to read from this Blogs-

   


aws eks supported kubernetes versions ,aws eks upgrade worker nodes ,aws eks update-kubeconfig ,upgrade eks cluster without downtime ,eks upgrade best practices ,aws eks version end of life ,eks 1.20 upgrade ,aws eks 1.19 end of life,
aws eks update nodegroup-config example ,aws eks managed node group ,aws eks add nodes to cluster ,eksctl upgrade nodegroup ,aws eks update-kubeconfig ,eks node group update ami ,eksctl update nodegroup instance type ,eks upgrade best practices