# Part 4: Upgrade

## What Will You Do

In part 4, you will:

- Perform an "in-place upgrade" of the EKS control plane and worker nodes to a more recent kubernetes version

Watch a video of this exercise.

[Upgrade EKS Cluster: Getting Started with Rafay Terraform Provider for EKS](https://www.youtube.com/watch?v=P4UW_bALt1g)

## Assumptions

This part assumes that you have completed [Part 1](https://docs.rafay.co/learn/quickstart/eks/clusterlifecycle/provision/) of this series and have a successfully provisioned and healthy EKS cluster.

---

## In-Place Upgrade

Select a method to provision and manage your EKS cluster from the tabs below.

[Web Console](https://docs.rafay.co/learn/quickstart/eks/clusterlifecycle/upgrade/#__tabbed_1_1)  
[RCTL CLI](https://docs.rafay.co/learn/quickstart/eks/clusterlifecycle/upgrade/#__tabbed_1_2)  
[Terrraform](https://docs.rafay.co/learn/quickstart/eks/clusterlifecycle/upgrade/#__tabbed_1_3)

## Step 1: Upgrade Control Plane and Node Pools

In this step, you will upgrade the kubernetes version for the control plane and the node pools.

Confirm the current control plane version of the cluster

- Navigate to the previously created project in your Org
- Go to Infrastructure -> Clusters and view the current version of the control plane

Confirm the current node pool version of the cluster

- Select Infrastructure -> Clusters
- Click on the cluster name on the cluster card
- Click the "Nodes" tab
- Expand the node card to see the version

- Select Infrastructure -> Clusters
- Click on "Upgrade Available" on the cluster card
- Select the version to upgrade to
- Select "Control Plane + Node Pools" for the EKS Version Upgrade Type
- Select the node pools to be upgraded
- Click "Upgrade"

The upgrade process will begin upgrading the control plane

The upgrade process will then move to upgrading the node pools

The completed upgrade will look like the below:

---

- Go to Infrastructure -> Clusters
- Click on the settings icon of the cluster and select "Download Cluster Config"
- Update the downloaded specification file with the new Kubernetes version

The updated YAML file will look like this:

```
kind: Cluster
metadata:
  name: demo-eks-testing
  project: defaultproject
spec:
  blueprint: minimal
  cloudprovider: demo
  cniprovider: aws-cni
  proxyconfig: {}
  type: eks
---
apiVersion: rafay.io/v1alpha5
kind: ClusterConfig
managedNodeGroups:
- amiFamily: AmazonLinux2
  desiredCapacity: 2
  iam:
    withAddonPolicies:
    autoScaler: true
  instanceType: t3.large
  maxSize: 2
  minSize: 1
  name: ng-1
  version: "1.23"
  volumeSize: 80
  volumeType: gp3
metadata:
  name: demo-eks-testing
  region: us-west-2
  version: "1.23"
vpc:
  cidr: 192.168.0.0/16
  clusterEndpoints:
    privateAccess: true
    publicAccess: false
  nat:
    gateway: Single
```

- Execute the following command to begin the upgrade of the control plane version

```
./rctl apply -f eks-cluster-testing.yaml
```

**_Expected output (with a task id):_**

```
Cluster: demo-eks-testing
{
  "taskset_id": "3mxdjkr",
  "operations": [\
    {\
      "operation": "ClusterUpgrade",\
      "resource_name": "demo-eks-testing",\
      "status": "PROVISION_TASK_STATUS_PENDING"\
    }\
  ],
  "comments": "The status of the operations can be fetched using taskset_id",
  "status": "PROVISION_TASKSET_STATUS_PENDING"
}
```

## Monitor Upgrade

From the web console, we can see that the upgrade is in progress. Note that the upgrade can take up to 40 minutes to complete.

Once the upgrade is complete, we can see that the kubernetes version of "both" the cluster control plane and the worker nodes have been upgraded.

---

## Recap

Congratulations! You have successfully performed an "in-place upgrade" of both the control plane and the worker nodes to a new version of Kubernetes.
