Perform a Manual Upgrade of a Non-Replicated TimesTenClassic Object

Let's perform a manual upgrade for a non-replicated TimesTenClassic object consisting of three independent TimesTen databases.
  1. Review the TimesTenClassic objects running in your namespace.
    kubectl get ttc

    The output is similar to the following:

    NAME             STATE              ACTIVE        AGE
    mannorepsample   AllReplicasReady   N/A           3m32s
    norepsample      AllReplicasReady   N/A           11h
    repsample        Normal             repsample-0   5d19h

    One of the non-replicated TimesTenClassic objects is mannorepsample. Its high level state is AllReplicasReady.

  2. Review the image upgrade strategy for this object.
    kubectl get ttc mannorepsample -o yaml | grep imageUpgradeStrategy

    The output is the following:

     imageUpgradeStrategy: Manual

    The image upgrade strategy is Manual. Let's perform an upgrade.

  3. On your development host, edit the TimesTenClassic object's .spec.ttspec.image datum with the container image you want to use for the upgrade. This example uses container-registry.oracle.com/timesten/timesten:22.1.1.35.0.
    1. Edit the file, replacing the image value with container-registry.oracle.com/timesten/timesten:22.1.1.35.0.
       kubectl edit ttc mannorepsample
      
      # Please edit the object below. Lines beginning with a '#' will be ignored,
      # and an empty file will abort the edit. If an error occurs while saving this file will be
      # reopened with the relevant failures.
      #
      apiVersion: timesten.oracle.com/v4
      kind: TimesTenClassic
      ...
          image: container-registry.oracle.com/timesten/timesten:22.1.1.35.0
      ...
    2. Save the file and exit from the editor.

    When the TimesTen Operator detects that there is an update to the TimesTenClassic's .spec.ttspec.image datum, it modifies the StatefulSet with the new image. Since this is a manual upgrade of a non-replicated object, the TimesTen Operator and Kubernetes take no further action.

  4. (Optional) Confirm the StatefulSet contains the new image.
    kubectl describe statefulset mannorepsample | grep Image
    

    The output is the following:

    Image:      container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:      container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:      container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:      container-registry.oracle.com/timesten/timesten:22.1.1.35.0

    The containers including tt, daemonlog, and exporter contain the new image.

  5. Review the Pods for the TimesTenClassic object.
    kubectl get pods

    The output is similar to the following:

    NAME                                 READY   STATUS    RESTARTS   AGE
    mannorepsample-0                     3/3     Running   0          26m
    mannorepsample-1                     3/3     Running   0          26m
    mannorepsample-2                     3/3     Running   0          26m
    ...

    There are three Pods associated with the TimesTenClassic object. Each Pod is running a TimesTen database. The databases are independent and have no relationship to each other.

  6. Delete the mannorepsample-2 Pod. This action causes Kubernetes to terminate the Pod and replace it with a new one.
    kubectl delete pod mannorepsample-2
  7. Monitor the progress.
    kubectl get ttc mannorepsample

    The output is the following:

    NAME             STATE               ACTIVE   AGE
    mannorepsample   SomeReplicasReady   N/A      49m

    The object is in the SomeReplicasReady state.

    Wait a few minutes. Then monitor again.

    kubectl get ttc mannorepsample

    The output is the following:

    
    NAME             STATE              ACTIVE   AGE
    mannorepsample   AllReplicasReady   N/A      53m

    The object is in the AllReplicasReady state. All replicas are ready and available. TimesTen databases are up and running and functioning properly.

  8. Check the image that the mannorepsample-2 Pod is running.
    kubectl describe pod mannorepsample-2 | grep Image
    The output is similar to the following:
    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0

    The containers in the Pod are running the new container image.

  9. Delete the remaining Pods.
    kubectl delete pod mannorepsample-1
    kubectl delete pod mannorepsample-0
  10. Monitor the progress.
    kubectl get pods

    The output is similar to the following:

    NAME                                 READY   STATUS     RESTARTS   AGE
    mannorepsample-0                     0/3     Init:0/1   0          13s
    mannorepsample-1                     0/3     Init:0/1   0          60s
    ...

    Kubernetes starts recreating the Pods.

    Wait a few minutes. Then monitor again.

    kubectl get pods

    The output is the following:

    NAME                                 READY   STATUS    RESTARTS   AGE
    mannorepsample-0                     3/3     Running   0          1m16s
    mannorepsample-1                     3/3     Running   0          2m3s
    mannorepsample-2                     3/3     Running   0          6m32s
    ...

    The mannorepsample-0 and mannorepsample-1 Pods are now running. The mannorepsample-2 has already been running.

  11. Confirm the Pods are running the new container image.

    Pod mannorepsample-0:

    kubectl describe pod mannorepsample-0 | grep Image

    The output is similar to the following:

    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0

    Pod mannorepsample-1:

    kubectl describe pod mannorepsample-1 | grep Image

    The output is similar to the following:

    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0
    Image:          container-registry.oracle.com/timesten/timesten:22.1.1.35.0

    The Pods are running the new image.

  12. (Optional) Confirm the state of the TimesTenClassic object.
    kubectl get ttc mannorepsample

    The output is similar to the following:

    NAME             STATE              ACTIVE   AGE
    mannorepsample   AllReplicasReady   N/A      79m
  13. Verify the databases are running the correct release.
    1. Establish a shell in the -0 Pod.
      kubectl exec -it mannorepsample-0 -c tt -- /bin/bash
    2. Run the TimesTen ttVersion utility.
      ttVersion
      The output is similar to the following:
      TimesTen Release 22.1.1.35.0 (64 bit Linux/x86_64) (instance1:6624) 2025-01-16T15:16:01Z
        Instance admin: timesten
        Instance home directory: /tt/home/timesten/instances/instance1
        Group owner: timesten
        Daemon home directory: /tt/home/timesten/instances/instance1/info
        PL/SQL enabled.
      
    3. Exit from the shell.
    4. Establish a shell in the -1 Pod.
      kubectl exec -it mannorepsample-1 -c tt -- /bin/bash
    5. Run the TimesTen ttVersion utility.
      ttVersion
      The output is similar to the following:
      TimesTen Release 22.1.1.35.0 (64 bit Linux/x86_64) (instance1:6624) 2025-01-16T15:16:01Z
        Instance admin: timesten
        Instance home directory: /tt/home/timesten/instances/instance1
        Group owner: timesten
        Daemon home directory: /tt/home/timesten/instances/instance1/info
        PL/SQL enabled.
      
    6. Exit from the shell.
    7. Establish a shell in the -2 Pod.
      kubectl exec -it mannorepsample-2 -c tt -- /bin/bash
    8. Run the TimesTen ttVersion utility.
      ttVersion
      The output is similar to the following:
      TimesTen Release 22.1.1.35.0 (64 bit Linux/x86_64) (instance1:6624) 2025-01-16T15:16:01Z
        Instance admin: timesten
        Instance home directory: /tt/home/timesten/instances/instance1
        Group owner: timesten
        Daemon home directory: /tt/home/timesten/instances/instance1/info
        PL/SQL enabled.
      
    9. Exit from the shell.
    The TimesTen databases are running the correct release of TimesTen.

Congratulations! You successfully performed a manual upgrade for a non-replicated TimesTenClassic object. All replicas are ready and available. Pods are running the new TimesTen container image. TimesTen databases are upgraded and fully operational.