- Kubernetesオペレータ・ユーザーズ・ガイド
- アップグレードの実行
- レプリケートされないTimesTenClassicオブジェクトの手動アップグレードの実行
レプリケートされない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.31.0
を使用します。- ファイルを編集し、
image
値をcontainer-registry.oracle.com/timesten/timesten:22.1.1.31.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/v3 kind: TimesTenClassic ... image: container-registry.oracle.com/timesten/timesten:22.1.1.31.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.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0
tt
、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.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0
ポッド内のコンテナでは、新しいコンテナ・イメージが実行されています。
- 残りのポッドを削除します。
kubectl delete pod mannorepsample-1
kubectl 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.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0
ポッド
mannorepsample-1
:kubectl describe pod mannorepsample-1 | grep Image
出力は、次のようになります。
Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.0 Image: container-registry.oracle.com/timesten/timesten:22.1.1.31.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.31.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.31.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.31.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データベースはアップグレードされ、完全に動作しています。