レプリケートされないTimesTenClassicオブジェクトの手動アップグレードの実行

3つの独立したTimesTenデータベースで構成されるレプリケートされないTimesTenClassicオブジェクトの手動アップグレードを実行します。
  1. ネームスペースで実行されている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です。

  2. このオブジェクトのイメージ・アップグレード・ストラテジを確認します。
    kubectl get ttc mannorepsample -o yaml | grep imageUpgradeStrategy

    出力は次のようになります。

     imageUpgradeStrategy: Manual

    イメージ・アップグレード・ストラテジはManualです。アップグレードを実行します。

  3. 開発ホストで、アップグレードに使用するコンテナ・イメージを使用して、TimesTenClassicオブジェクトの.spec.ttspec.imageデータ項目を編集します。この例では、container-registry.oracle.com/timesten/timesten:22.1.1.31.0を使用します。
    1. ファイルを編集し、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
      ...
    2. ファイルを保存して、エディタを終了します。

    TimesTenオペレータは、TimesTenClassicの.spec.ttspec.imageデータ項目への更新があることを検出すると、新しいイメージでStatefulSetを変更します。これはレプリケートされないオブジェクトの手動アップグレードであるため、TimesTenオペレータおよびKubernetesはそれ以降の処理を実行しません。

  4. (オプション) 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

    ttdaemonlogおよびexporterを含むコンテナには、新しいイメージが含まれています。

  5. 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データベースが実行されています。データベースは独立しており、相互に関係はありません。

  6. mannorepsample-2ポッドを削除します。この処理により、Kubernetesはポッドを終了し、新しいポッドに置き換えます。
    kubectl delete pod mannorepsample-2
  7. 進捗を監視します。
    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データベースは稼働中であり、正しく機能しています。

  8. 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

    ポッド内のコンテナでは、新しいコンテナ・イメージが実行されています。

  9. 残りのポッドを削除します。
    kubectl delete pod mannorepsample-1
    kubectl delete pod mannorepsample-0
  10. 進捗を監視します。
    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はすでに実行されています。

  11. ポッドが新しいコンテナ・イメージを実行していることを確認します。

    ポッド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

    ポッドでは、新しいイメージが実行されています。

  12. (オプション) TimesTenClassicオブジェクトの状態を確認します。
    kubectl get ttc mannorepsample

    出力は、次のようになります。

    NAME             STATE              ACTIVE   AGE
    mannorepsample   AllReplicasReady   N/A      79m
  13. データベースが正しいリリースを実行していることを確認します。
    1. -0ポッドにシェルを設定します。
      kubectl exec -it mannorepsample-0 -c tt -- /bin/bash
    2. 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.
      
    3. シェルを終了します。
    4. -1ポッドにシェルを設定します。
      kubectl exec -it mannorepsample-1 -c tt -- /bin/bash
    5. 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.
      
    6. シェルを終了します。
    7. -2ポッドにシェルを設定します。
      kubectl exec -it mannorepsample-2 -c tt -- /bin/bash
    8. 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.
      
    9. シェルを終了します。
    TimesTenデータベースでは、TimesTenの正しいリリースが実行されています。

おめでとうございます。レプリケートされないTimesTenClassicオブジェクトの手動アップグレードが正常に実行されました。すべてのレプリカが準備でき、使用可能になります。ポッドでは、新しいTimesTenコンテナ・イメージが実行されています。TimesTenデータベースはアップグレードされ、完全に動作しています。