Upgrade Oracle Kubernetes Engine on the the Oracle Cloud

Your Oracle Container Cluster is not automatically upgraded to new versions as the come out.  Automatically upgrading your cluster could cause problems if you’re running an application that would fail on a newer version.

However, the process to upgrade your Oracle Container Cluster is fairly straight forward.

Warning

Before you upgrade your Container Cluster, make sure all of your deployed apps will work with the version you intend to upgrade to.

Prerequisites

Open the Cluster details page

From your Oracle Cloud Dashboard

  1. Click the menu icon in the upper left.
  2. Find “Developer Services”.
  3. Click Container Services (OKE).
  4. Select the cluster you want to upgrade.

If there’s an upgrade available you’ll find a button next to the delete button on the details page.  Unfortunately, I had upgraded my cluster before I took a screenshot.  But, I used my amazing image editing skills to add a button to the picture below.

Push the upgrade button and you will see a list of the versions that are available.  You can upgrade 1 version at a time until you get to the current version.   If you’re upgrading across multiple versions, I recommend testing your deployed apps after each upgrade.

Worker Nodes

Worker nodes will not automatically upgrade with the master node.  If you have worker nodes that are more that 2 versions behind the master you will receive an error when you attempt to upgrade the cluster beyond that point.

I’m sure you could upgrade the worker nodes in your node pools manually, but I decided to take the easy route and…

Migrate to New Worker Nodes
  1. In your cluster details page, under resources, click “Node Pools”.
  2. Open your node pool details page.
  3. Under resources click nodes.
  4. For each node, collect the private IP and any custom settings, save them for later.  You could also keep this page open in a separate window.
  5. Go back to your cluster details page, and click the “Add Node Pool” button.
  6. Create a new pool using the same settings for the current pool and its nodes.
  7. Wait until all Nodes are “Ready”.
  8. In a terminal use kubectrl to drain the existing pool.
    Once the current pool is drained, Kubernetes should automatically move all of the pods from the drained pool into nodes in in the new pool.
    If you’ve manually assigned your pods to a specific node, you will need to move the pod manually. (Not covered here.)
  9. Open the Kubernetes API, make sure all of the pods are running on the new pool’s nodes.
  10. Go back to the Oracle Container Cluster details page, under resources, Open the drained node pool.
  11. Click “Delete Node Pool”.
  12. If you have multiple Node Pools, repeat these steps for each pool.

If your cluster was more than 2 versions behind you may have to repeat this process until you’re on the current version.

Leave a Reply