Roll back a Non-Replicated TimesTen Upgrade
You can use Helm to roll back an upgrade of a non-replicated TimesTenClassic object. This reverts the non-replicated TimesTenClassic object and its associated TimesTen databases to the downgraded release.
- Before the rollback, do the following:
- Confirm the non-replicated TimesTenClassic object exists in your namespace.
kubectl get ttcThe output is similar to the following:NAME STATE ACTIVE AGE norepsamplehelm AllReplicasReady N/A 20h repsamplehelm Normal repsamplehelm-0 23hThe
norepsamplehelmTimesTenClassic object exists and is in theAllReplicasReadystate. - Verify the image and the value of
rollingUpdatePartition.kubectl get ttc norepsamplehelm -o yaml | grep 'image\|rollingUpdatePartition'The output is similar to the following:image: container-registry.oracle.com/timesten/timesten:22.1.1.35.0 ... rollingUpdatePartition: 0 ...The current value for
rollingUpdatePartitionis0. However, the value used for the downgrade is the original value ofrollingUpdatePartition. In the example, the original value is2. If you roll back to the original chart release in which therollingUpdatePartitionvalue is2, Kubernetes only downgrades the-2Pod. An upcoming step illustrates this.
- Confirm the non-replicated TimesTenClassic object exists in your namespace.
- Review the revision history.
helm history norepsamplehelmThe output is similar to the following:REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION 1 Thu Jan 16 17:42:47 2025 superseded ttclassic-2211340.1.0 22.1.1.34.0 Install complete 2 Fri Jan 17 04:22:15 2025 superseded ttclassic-2211350.1.0 22.1.1.35.0 Upgrade complete 3 Fri Jan 17 04:56:32 2025 deployed ttclassic-2211350.1.0 22.1.1.35.0 Upgrade completeRevision
3of thenorepsamplehelmchart is running release22.1.1.35.0. Revision1is running release22.1.1.34.0. - Roll back to revision
1.helm rollback norepsamplehelm 1The output is the following:
Rollback was a success! Happy Helming! - Monitor the progress.
kubectl get ttc norepsamplehelmThe output is similar to the following:
NAME STATE ACTIVE AGE norepsamplehelm SomeReplicasReady N/A 20hThe object is in the
SomeReplicasReadystate.Wait a few minutes. Then, monitor again.
kubectl get ttc norepsamplehelmThe output is similar to the following:
NAME STATE ACTIVE AGE norepsamplehelm AllReplicasReady N/A 20hThe object is in the
AllReplicasReadystate. All replicas are ready and available. TimesTen databases are up and running and functioning properly. - Check the
rollingUpdatePartitionvalue and the image for the Pods.- Check the value of
rollingUpdatePartition.kubectl get ttc norepsamplehelm -o yaml | grep rollingUpdatePartitionThe output is similar to the following:
rollingUpdatePartition: 2As part of the downgrade process, the value of
rollingUpdatePartitionchanges to its original value of2. - Check the
norepsamplehelm-2Pod.kubectl describe pod norepsamplehelm-2 | grep ImageThe output is similar to the following:
Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0The containers in the Pod are running the downgraded image. Due to the
rollingUpdatePartitionvalue of2, Kubernetes updated this Pod with the downgraded image. This is correct behavior. - Check the
norepsamplehelm-1Pod.kubectl describe pod norepsamplehelm-1 | grep ImageThe 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.0The containers in the Pod are not running the downgraded image. Due to the
rollingUpdatePartitionvalue of2, Kubernetes does not update this Pod with the downgraded image. This is correct behavior. - Check the
norepsamplehelm-0Pod.kubectl describe pod norepsamplehelm-0 | grep ImageThe 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.0The containers in the Pod are not running the downgraded image. Due to the
rollingUpdatePartitionvalue of2, Kubernetes does not updated this Pod with the downgraded image. This is correct behavior.
After you confirm the downgrade is working, you can downgrade the remaining Pods. - Check the value of
- Create a new YAML file and in it specify the
rollingUpdatePartitionvariable and set the value to0.vi customyaml/changerollingupdate0.yaml rollingUpdatePartition: 0 - Change the
rollingUpdatePartitionvalue.Note:
We recommend the following syntax. This ensures existing customizations are preserved.helm get values norepsamplehelm --all > prev-values-noreprolling0.yaml && helm upgrade -f prev-values-noreprolling0.yaml -f customyaml/changerollingupdate0.yaml norepsamplehelm ./ttclassicThe output is similar to the following:Release "norepsamplehelm" has been upgraded. Happy Helming! NAME: norepsamplehelm LAST DEPLOYED: Fri Jan 17 15:09:42 2025 NAMESPACE: default STATUS: deployed REVISION: 5 NOTES: Version 2211340.1.0 of the ttclassic chart has been installed. This release is named "norepsamplehelm". To learn more about the release, try: $ helm status norepsamplehelm $ helm get all norepsamplehelm $ helm history norepsamplehelm To rollback to a previous version of the chart, run: $ helm rollback norepsamplehelm <REVISION> - run 'helm history norepsamplehelm' for a list of revisions.Kubernetes automatically begins to terminate Pods and replace them with new ones. These new Pods run the downgraded image. Since
rollingUpdatePartitionis now0, you should expect to see thenorepsamplehelm-1andnorepsamplehelm-0Pods updated with the downgraded image. - Monitor the progress.
- TimesTenClassic object:
kubectl get ttc norepsamplehelmThe output is similar to the following
NAME STATE ACTIVE AGE norepsamplehelm SomeReplicasReady N/A 21h - Pods:
kubectl get podsThe output is similar to the following:
NAME READY STATUS RESTARTS AGE norepsamplehelm-0 3/3 Running 0 10h norepsamplehelm-1 0/3 Init:0/1 0 73s norepsamplehelm-2 3/3 Running 0 34mKubernetes replaces the
norepsamplehelm-1Pod first. Wait a few minutes. Then monitor again.kubectl get podsThe output is similar to the following:
NAME READY STATUS RESTARTS AGE norepsamplehelm-0 3/3 Running 0 7m24s norepsamplehelm-1 3/3 Running 0 9m49s norepsamplehelm-2 3/3 Running 0 42mKubernetes replaced the
norepsamplehelm-1and thenorepsamplehelm-0Pods. All Pods are running.
- TimesTenClassic object:
- Confirm the Pods are running the downgraded container image.
Pod
norepsamplehelm-1:kubectl describe pod norepsamplehelm-1 | grep ImageThe output is similar to the following:
Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0Pod
norepsamplehelm-0:kubectl describe pod norepsamplehelm-0 | grep ImageThe output is similar to the following:
Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.34.0The Pods are running the new image.
- Confirm the value of
rollingUpdatePartition.kubectl get ttc norepsamplehelm -o yaml | grep rollingUpdatePartitionThe output is similar to the following:
rollingUpdatePartition: 0 - Confirm the state of the TimesTenClassic object.
kubectl get ttc norepsamplehelmThe output is similar to the following:
NAME STATE ACTIVE AGE norepsamplehelm AllReplicasReady N/A 21h - Check the history.
helm history norepsamplehelmThe output is similar to the following:
REVISION UPDATED STATUS CHART APP VERSION DESCRIPTION 1 Thu Jan 16 17:42:47 2025 superseded ttclassic-2211340.1.0 22.1.1.34.0 Install complete 2 Fri Jan 17 04:22:15 2025 superseded ttclassic-2211350.1.0 22.1.1.35.0 Upgrade complete 3 Fri Jan 17 04:56:32 2025 superseded ttclassic-2211350.1.0 22.1.1.35.0 Upgrade complete 4 Fri Jan 17 14:36:43 2025 superseded ttclassic-2211340.1.0 22.1.1.34.0 Rollback to 1 5 Fri Jan 17 15:09:42 2025 deployed ttclassic-2211340.1.0 22.1.1.34.0 Upgrade completeRevision
5is running the2211340.1.0chart. - Confirm the
norepsamplehelmrelease is downgraded.helm listThe output is similar to the following:NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION norepsamplehelm default 5 2025-01-07 15:09:42.959017268 +0000 UTC deployed ttclassic-2211340.1.0 22.1.1.34.0The
norepsamplehelmchart release is downgraded.
AllReplicasReady state. All replicas are ready and available. Pods are running the downgraded TimesTen container image. TimesTen databases are upgraded and fully operational.