レプリケートされないTimesTenClassicオブジェクトの手動アップグレードの実行
- ネームスペースで実行されているTimesTenClassicオブジェクトを確認します。
kubectl get ttc出力は、次のようになります。
NAME STATE ACTIVE AGE mannorepsample AllReplicasReady N/A 3m32s norepsample AllReplicasReady N/A 11h repsample Normal repsample-0 5d19hレプリケートされないTimesTenClassicオブジェクトの1つは、
mannorepsampleです。高レベル状態はAllReplicasReadyです。 - このオブジェクトのイメージ・アップグレード・ストラテジを確認します。
kubectl get ttc mannorepsample -o yaml | grep imageUpgradeStrategy出力は次のようになります。
imageUpgradeStrategy: Manualイメージ・アップグレード・ストラテジは
Manualです。アップグレードを実行します。 - 開発ホストで、アップグレードに使用するコンテナ・イメージを使用して、TimesTenClassicオブジェクトの
.spec.ttspec.imageデータ項目を編集します。この例では、container-registry.oracle.com/timesten/timesten:22.1.1.35.0を使用します。- ファイルを編集し、
image値を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 ... - ファイルを保存して、エディタを終了します。
TimesTenオペレータは、TimesTenClassicの
.spec.ttspec.imageデータ項目への更新があることを検出すると、新しいイメージでStatefulSetを変更します。これはレプリケートされないオブジェクトの手動アップグレードであるため、TimesTenオペレータおよびKubernetesはそれ以降の処理を実行しません。 - ファイルを編集し、
- (オプション) StatefulSetに新しいイメージが含まれていることを確認します。
kubectl describe statefulset mannorepsample | 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.0tt、daemonlogおよびexporterを含むコンテナには、新しいイメージが含まれています。 - TimesTenClassicオブジェクトのポッドを確認します。
kubectl get pods出力は、次のようになります。
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 ...TimesTenClassicオブジェクトには3つのポッドが関連付けられています。各ポッドでは、TimesTenデータベースが実行されています。データベースは独立しており、相互に関係はありません。
mannorepsample-2ポッドを削除します。この処理により、Kubernetesはポッドを終了し、新しいポッドに置き換えます。kubectl delete pod mannorepsample-2- 進捗を監視します。
kubectl get ttc mannorepsample出力は次のようになります。
NAME STATE ACTIVE AGE mannorepsample SomeReplicasReady N/A 49mオブジェクトは
SomeReplicasReady状態です。数分間待機します。次に、再度監視します。
kubectl get ttc mannorepsample出力は次のようになります。
NAME STATE ACTIVE AGE mannorepsample AllReplicasReady N/A 53mオブジェクトは
AllReplicasReady状態です。すべてのレプリカが準備でき、使用可能になります。TimesTenデータベースは稼働中であり、正しく機能しています。 mannorepsample-2ポッドが実行しているイメージを確認します。kubectl describe pod mannorepsample-2 | 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ポッド内のコンテナでは、新しいコンテナ・イメージが実行されています。
- 残りのポッドを削除します。
kubectl delete pod mannorepsample-1kubectl delete pod mannorepsample-0 - 進捗を監視します。
kubectl get pods出力は、次のようになります。
NAME READY STATUS RESTARTS AGE mannorepsample-0 0/3 Init:0/1 0 13s mannorepsample-1 0/3 Init:0/1 0 60s ...Kubernetesはポッドの再作成を開始します。
数分間待機します。次に、再度監視します。
kubectl get pods出力は次のようになります。
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 ...mannorepsample-0およびmannorepsample-1ポッドが実行されています。mannorepsample-2はすでに実行されています。 - ポッドが新しいコンテナ・イメージを実行していることを確認します。
ポッド
mannorepsample-0:kubectl describe pod mannorepsample-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ポッド
mannorepsample-1:kubectl describe pod mannorepsample-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ポッドでは、新しいイメージが実行されています。
- (オプション) TimesTenClassicオブジェクトの状態を確認します。
kubectl get ttc mannorepsample出力は、次のようになります。
NAME STATE ACTIVE AGE mannorepsample AllReplicasReady N/A 79m - データベースが正しいリリースを実行していることを確認します。
-0ポッドにシェルを設定します。kubectl exec -it mannorepsample-0 -c tt -- /bin/bash- TimesTen
ttVersionユーティリティを実行します。ttVersion出力は、次のようになります。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. - シェルを終了します。
-1ポッドにシェルを設定します。kubectl exec -it mannorepsample-1 -c tt -- /bin/bash- TimesTen
ttVersionユーティリティを実行します。ttVersion出力は、次のようになります。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. - シェルを終了します。
-2ポッドにシェルを設定します。kubectl exec -it mannorepsample-2 -c tt -- /bin/bash- TimesTen
ttVersionユーティリティを実行します。ttVersion出力は、次のようになります。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. - シェルを終了します。
TimesTenデータベースでは、TimesTenの正しいリリースが実行されています。
おめでとうございます。レプリケートされないTimesTenClassicオブジェクトの手動アップグレードが正常に実行されました。すべてのレプリカが準備でき、使用可能になります。ポッドでは、新しいTimesTenコンテナ・イメージが実行されています。TimesTenデータベースはアップグレードされ、完全に動作しています。