Upgrade Cluster and Node Pool Using Script

You can use the upgrade_cluster.py script to upgrade the Kubernetes version of the cluster and the node pools in your Oracle WebLogic Server for OKE stack.

The script upgrades the cluster and the node pool to the specified target version.

After you upgrade make sure that your kubectl version aligns with the Kubernetes version of the cluster.

Prerequisites:

Complete the following steps before you run the upgrade script:
  1. Access the administration instance. See Access the Administration Instance.
  2. Run the following command:
    sudo bash
    python3 -m pip install oci==2.90

    If the pip command fails, then use the yum command to install OCI Python SDK.

    yum install python36-oci-sdk

Upgrade the cluster and node pool using the script

You can use the script to upgrade the cluster, the node pool, or both cluster and node pool.

  1. Access the administration instance. See Access the Administration Instance.
  2. Go to /u01/scripts/utils location and locate upgrade_cluster.py. If it is not there, create one.
  3. Copy and paste the script specified in Script file for Upgrade Cluster and Node Pool to the upgrade_cluster.py file.
  4. Run the following commands:

    Note:

    The current Kubernetes version supported for Oracle WebLogic Server for OKE is 1.28.2 and 1.30.1. For the latest Kubernetes versions, see Currently Supported Kubernetes Versions in the Oracle Cloud Infrastructure documentation.

    When you are running the script to upgrade the cluster and node pool, you will see a downtime for the domain pods and Jenkins.

    • To upgrade the cluster and node pool:
      python3 /u01/scripts/utils/upgrade_cluster.py <target_k8s_version>
    • To upgrade only the cluster:
      python3 /u01/scripts/utils/upgrade_cluster.py <target_k8s_version> cluster
    • To upgrade only the node pool:
      python3 /u01/scripts/utils/upgrade_cluster.py <target_k8s_version> nodepool
  5. Wait for the Node State of the nodes in the node pool to change to Active.
  6. Use this Command to check if all the pods are up and running:
    kubectl get pods -A
    If you are reusing the namespaces, use the following command to verify if the domain pods are up and running:
    kubectl get pods -n <namespace>
  7. Verify if Jenkins is up and running by accessing the Jenkins console. See Access the Jenkins Console.