Perform a Manual Upgrade of a Non-Replicated TimesTenClassic Object
- 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 isAllReplicasReady
. - 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. - 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 usescontainer-registry.oracle.com/timesten/timesten:22.1.1.35.0
.- Edit the file, replacing the
image
value withcontainer-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 ...
- 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. - Edit the file, replacing the
- (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
, andexporter
contain the new image. - 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.
- 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
- 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. - 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.
- Delete the remaining Pods.
kubectl delete pod mannorepsample-1
kubectl delete pod mannorepsample-0
- 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
andmannorepsample-1
Pods are now running. Themannorepsample-2
has already been running. - 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.
- (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
- Verify the databases are running the correct release.
- Establish a shell in the
-0
Pod.kubectl exec -it mannorepsample-0 -c tt -- /bin/bash
- 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.
- Exit from the shell.
- Establish a shell in the
-1
Pod.kubectl exec -it mannorepsample-1 -c tt -- /bin/bash
- 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.
- Exit from the shell.
- Establish a shell in the
-2
Pod.kubectl exec -it mannorepsample-2 -c tt -- /bin/bash
- 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.
- Exit from the shell.
The TimesTen databases are running the correct release of TimesTen. - Establish a shell in the
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.