Upgrade Non-Replicated TimesTen Databases
Let's perform an upgrade of a non-replicated TimesTenClassic object consisting of three independent TimesTen databases.
-
Create a YAML file. In this file, you specify the container image that contains the new release of TimesTen.
-
Use the
helmvaluescommand for the upgrade. The example shows you how to do this.
In addition, the example shows you how to change the value for the rollingUpdatePartition variable.
- On your development host, change to the
helmdirectory that contains the new Helm charts.cd new_kube_files/helm - Create a YAML file and in it specify the name of the TimesTen image you want to use for the upgrade.
vi customyaml/upgradenonreplicated.yaml image: repository: container-registry.oracle.com/timesten/timesten tag: "22.1.1.35.0" - Before the upgrade, 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 10h repsamplehelm Normal repsamplehelm-1 13hThe
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.34.0 ... rollingUpdatePartition: 2 ...The value for
rollingUpdatePartitionis2, indicating that Kubernetes upgrades Pods with an ordinal value greater than or equal to2. For thenorepsamplehelmobject, since the value ofreplicasis3, there are three Pods namednorepsamplehelm-0,norepsamplehelm-1, andnorepsamplehelm-2. Therefore, Kubernetes only upgrades thenorepsamplehelm-2Pod.
- Confirm the non-replicated TimesTenClassic object exists in your namespace.
- Confirm the
ttclassicchart release.helm listThe output is similar to the following:NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION norepsamplehelm default 1 2025-01-16 17:42:47.180635098 +0000 UTC deployed ttclassic-2211340.1.0 22.1.1.34.0 - Upgrade to the new release. Use the
ttclassicchart from the new release and use the customized YAML file that references the new image.Note:
We recommend the following syntax. This ensures existing customizations are preserved.helm get values norepsamplehelm --all > prev-values-norepttc.yamlhelm upgrade -f prev-values-norepttc.yaml -f customyaml/upgradenonreplicated.yaml norepsamplehelm ./ttclassicLet's look at thishelmupgradecommand:-
The
get values norepsamplehelmHelm command retrieves the values for the current release, including existing customizations. The result of this command is piped into theprev-values-norepttc.yamlfile. You can choose any name for this file. -
The
helmupgradecommand uses theprev-values-norepttc.yamlfile with the customizedupgradenonreplicated.yamlfile to do the upgrade.
Let's look at the output from the
helmupgradecommand.Release "norepsamplehelm" has been upgraded. Happy Helming! NAME: norepsamplehelm LAST DEPLOYED: Thu Jan 16 04:22:15 2025 NAMESPACE: default STATUS: deployed REVISION: 2 NOTES: Version 2211350.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.Note the following:-
The
norepsamplehelmchart release is upgraded. The release revision is2. -
The status of the release is
deployed. -
The
ttclassicchart version is2211350.1.0corresponding to TimesTen release22.1.1.35.0.
-
- Monitor the progress.
kubectl get ttc norepsamplehelmThe output is similar to the following:
NAME STATE ACTIVE AGE norepsamplehelm SomeReplicasReady N/A 10hThe 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 10hThe object is in the
AllReplicasReadystate. All replicas are ready and available. TimesTen databases are up and running and functioning properly. - Check the image that the
norepsamplehelm-2Pod is running.kubectl describe pod norepsamplehelm-2 | 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 running the new container image.
- Check the image for the
norepsamplehelm-1andnorepsamplehelm-0Pods.- 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.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 not running the new image. Due to the
rollingUpdatePartitionvalue of2, Kubernetes does not upgrade this Pod with the new 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.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 not running the new image. Due to the
rollingUpdatePartitionvalue of2, Kubernetes does not upgrade this Pod with the new image. This is correct behavior.
After you confirm the upgrade is working, you can upgrade the remaining Pods. - Check the
- Create a YAML file and in it specify the
rollingUpdatePartitionvariable and set the value to0.vi customyaml/changerollingupdate.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-noreprolling.yaml && helm upgrade -f prev-values-noreprolling.yaml -f customyaml/changerollingupdate.yaml norepsamplehelm ./ttclassicThe output is similar to the following:Release "norepsamplehelm" has been upgraded. Happy Helming! NAME: norepsamplehelm LAST DEPLOYED: Thu Jan 16 04:56:32 2025 NAMESPACE: default STATUS: deployed REVISION: 3 NOTES: Version 2211350.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 new image. Since
rollingUpdatePartitionis now0, you should expect to see thenorepsamplehelm-1andnorepsamplehelm-0Pods upgraded with the new image. - Monitor the progress.
- TimesTenClassic object:
kubectl get ttc norepsamplehelmThe output is similar to the following
NAME STATE ACTIVE AGE norepsamplehelm SomeReplicasReady N/A 11h - Pods:
kubectl get podsThe output is similar to the following:
NAME READY STATUS RESTARTS AGE norepsamplehelm-0 3/3 Running 0 11h norepsamplehelm-1 0/3 Init:0/1 0 31s 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 3m14s norepsamplehelm-1 3/3 Running 0 6m8s norepsamplehelm-2 3/3 Running 0 40mKubernetes replaced the
norepsamplehelm-1and thenorepsamplehelm-0Pods. All Pods are running.
- TimesTenClassic object:
- Confirm the Pods are running the new 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.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.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.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 Pods are running the new image.
- 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 11h
Congratulations! You successfully performed an automated 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.