レプリケートされないTimesTenアップグレードのロールバック
Helmを使用して、レプリケートされないTimesTenClassicオブジェクトのアップグレードをロールバックできます。これにより、レプリケートされないTimesTenClassicオブジェクトとその関連TimesTenデータベースがダウングレードされたリリースに戻ります。
- ロールバックの前に、次を実行します:
- レプリケートされないTimesTenClassicオブジェクトがネームスペースに存在することを確認します。
kubectl get ttc
出力は、次のようになります。NAME STATE ACTIVE AGE norepsamplehelm AllReplicasReady N/A 20h repsamplehelm Normal repsamplehelm-0 23h
norepsamplehelm
TimesTenClassicオブジェクトが存在し、AllReplicasReady
状態です。 - イメージおよび
rollingUpdatePartition
の値を確認します。kubectl get ttc norepsamplehelm -o yaml | grep 'image\|rollingUpdatePartition'
出力は、次のようになります。image: container-registry.oracle.com/timesten/timesten:22.1.1.35.0 ... rollingUpdatePartition: 0 ...
rollingUpdatePartition
の現在の値は0
です。ただし、ダウングレードに使用される値は、rollingUpdatePartition
の元の値です。この例では、元の値は2
です。rollingUpdatePartition
値が2
の元のチャート・リリースにロールバックすると、Kubernetesは-2
ポッドのみをダウングレードします。次のステップがこれを示しています。
- レプリケートされないTimesTenClassicオブジェクトがネームスペースに存在することを確認します。
- リビジョン履歴を確認します。
helm history norepsamplehelm
出力は、次のようになります。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 complete
norepsamplehelm
チャートのリビジョン3
は、リリース22.1.1.35.0
を実行しています。リビジョン1
はリリース22.1.1.34.0
を実行しています。 - リビジョン
1
にロールバックします。helm rollback norepsamplehelm 1
出力は次のようになります。
Rollback was a success! Happy Helming!
- 進捗を監視します。
kubectl get ttc norepsamplehelm
出力は、次のようになります。
NAME STATE ACTIVE AGE norepsamplehelm SomeReplicasReady N/A 20h
オブジェクトは
SomeReplicasReady
状態です。数分間待機します。次に、再度監視します。
kubectl get ttc norepsamplehelm
出力は、次のようになります。
NAME STATE ACTIVE AGE norepsamplehelm AllReplicasReady N/A 20h
オブジェクトは
AllReplicasReady
状態です。すべてのレプリカが準備でき、使用可能になります。TimesTenデータベースは稼働中であり、正しく機能しています。 rollingUpdatePartition
値とポッドのイメージを確認します。rollingUpdatePartition
の値を確認します。kubectl get ttc norepsamplehelm -o yaml | grep rollingUpdatePartition
出力は、次のようになります。
rollingUpdatePartition: 2
ダウングレード・プロセスの一環として、
rollingUpdatePartition
の値は2
の元の値に変更されます。norepsamplehelm-2
ポッドを確認します。kubectl describe pod norepsamplehelm-2 | grep Image
出力は、次のようになります。
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.0
ポッド内のコンテナでは、ダウングレードされたイメージが実行されています。
2
のrollingUpdatePartition
値により、Kubernetesはこのポッドをダウングレードされたイメージで更新しました。これは正常な動作です。norepsamplehelm-1
ポッドを確認します。kubectl describe pod norepsamplehelm-1 | grep Image
出力は、次のようになります。
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
ポッド内のコンテナでは、ダウングレードされたイメージは実行されていません。
2
のrollingUpdatePartition
値により、Kubernetesはこのポッドをダウングレードされたイメージで更新しません。これは正常な動作です。norepsamplehelm-0
ポッドを確認します。kubectl describe pod norepsamplehelm-0 | grep Image
出力は、次のようになります。
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
ポッド内のコンテナでは、ダウングレードされたイメージは実行されていません。
2
のrollingUpdatePartition
値により、Kubernetesはこのポッドをダウングレードされたイメージで更新しません。これは正常な動作です。
ダウングレードが機能していることを確認したら、残りのポッドをダウングレードできます。- 新しいYAMLファイルを作成し、そのファイルに
rollingUpdatePartition
変数を指定し、値を0
に設定します。vi customyaml/changerollingupdate0.yaml rollingUpdatePartition: 0
rollingUpdatePartition
値を変更します。ノート:
次の構文をお薦めします。これにより、既存のカスタマイズが保持されます。helm get values norepsamplehelm --all > prev-values-noreprolling0.yaml && helm upgrade -f prev-values-noreprolling0.yaml -f customyaml/changerollingupdate0.yaml norepsamplehelm ./ttclassic
出力は、次のようになります。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は自動的にポッドを終了し、新しいポッドに置き換えます。これらの新しいポッドはダウングレードされたイメージを実行します。
rollingUpdatePartition
は現在0
であるため、ダウングレードされたイメージで更新されたnorepsamplehelm-1
およびnorepsamplehelm-0
ポッドが表示されます。- 進捗を監視します。
- TimesTenClassicオブジェクト:
kubectl get ttc norepsamplehelm
出力は次のようになります
NAME STATE ACTIVE AGE norepsamplehelm SomeReplicasReady N/A 21h
- Pods:
kubectl get pods
出力は、次のようになります。
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 34m
Kubernetesは、最初に
norepsamplehelm-1
ポッドを置き換えます。数分間待機します。次に、再度監視します。kubectl get pods
出力は、次のようになります。
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 42m
Kubernetesにより、
norepsamplehelm-1
およびnorepsamplehelm-0
ポッドが置き換わりました。すべてのポッドが実行されています。
- TimesTenClassicオブジェクト:
- ポッドがダウングレードされたコンテナ・イメージを実行していることを確認します。
ポッド
norepsamplehelm-1:
kubectl describe pod norepsamplehelm-1 | grep Image
出力は、次のようになります。
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.0
ポッド
norepsamplehelm-0
:kubectl describe pod norepsamplehelm-0 | grep Image
出力は、次のようになります。
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.0
ポッドでは、新しいイメージが実行されています。
rollingUpdatePartition
の値を確認します。kubectl get ttc norepsamplehelm -o yaml | grep rollingUpdatePartition
出力は、次のようになります。
rollingUpdatePartition: 0
- TimesTenClassicオブジェクトの状態を確認します。
kubectl get ttc norepsamplehelm
出力は、次のようになります。
NAME STATE ACTIVE AGE norepsamplehelm AllReplicasReady N/A 21h
- 履歴を確認します。
helm history norepsamplehelm
出力は、次のようになります。
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 complete
リビジョン
5
は、2211340.1.0
チャートを実行しています。 norepsamplehelm
リリースがダウングレードされていることを確認します。helm list
出力は、次のようになります。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.0
norepsamplehelm
チャート・リリースがダウングレードされています。
AllReplicasReady
状態です。すべてのレプリカが準備でき、使用可能になります。ポッドでは、ダウングレードされたTimesTenコンテナ・イメージが実行されています。TimesTenデータベースはアップグレードされ、完全に動作しています。