管理の一時停止

TimesTenオペレータに、ネームスペースで実行されている1つ以上のTimesTenClassicオブジェクトの管理を停止するように指示できます。これを実行するには、TimesTenClassicオブジェクトの.spec.ttspec.stopManagingデータ項目を使用します。

次に例を示します

  1. ネームスペースで実行されているTimesTenClassicオブジェクトを確認します。
    kubectl get ttc
    出力は、次のようになります。
    NAME             STATE              ACTIVE           AGE
    samplenorep      AllReplicasReady   N/A              47h
    samplerep        Normal             samplerep-0      2d
    2つのTimesTenClassicオブジェクトがあります。samplenorepはレプリケートされないオブジェクトで、すべてのレプリカの準備が完了しています。samplerepは、Normal状態のレプリケート・オブジェクトです。
  2. ポッドを確認します。
    kubectl get pods

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

    NAME                                 READY   STATUS    RESTARTS   AGE
    samplenorep-0                        3/3     Running   0          47h
    samplenorep-1                        3/3     Running   0          47h
    samplenorep-2                        3/3     Running   0          47h
    samplerep-0                          3/3     Running   0          2d
    samplerep-1                          2/3     Running   0          2d
    timesten-operator-6b9b7f8fb4-vvl69   1/1     Running   0          2d1h

    レプリケートされないsamplenorepオブジェクトの場合、3つのデータベース(replicas=3)を表す3つのポッドが実行されています。samplerepレプリケート・オブジェクトでは、2つのポッドが実行されています。アクティブ・データベース(samplerep-0)を表すポッドと、スタンバイ・データベース(samplerep-1)を表すポッドがあります。

  3. samplenorepオブジェクトの管理を停止するようにTimesTenオペレータに指示します。
    1. kubectl editコマンドを使用して、オブジェクトを編集します。

      ファイル内に.spec.ttspec.stopManagingの行がある場合は、その値を変更します。現在の値と異なる必要があります。行がない場合は、行を追加して値を指定します。

      この例では、.spec.ttspec.stopManagingデータ項目を追加し、値をstopManagingNowに設定します。

      kubectl edit ttc samplenorep
      
      # 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
      metadata:
      ...
      spec:
        ttspec:
          additionalMemoryRequest: 2Gi
          automaticMemoryRequests: true
          cacheCleanup: true
          createASReadinessProbe: true
          daemonLogCPURequest: 200m
          daemonLogMemoryRequest: 200Mi
          stopManaging: stopManagingNow
      ...
    2. ファイルを保存して閉じます。
  4. samplenorepオブジェクトがManualInterventionRequired状態であることを確認します。
    kubectl get ttc
    出力は、次のようになります。
    NAME             STATE                        ACTIVE           AGE
    samplenorep      ManualInterventionRequired   N/A              2d
    samplerep        Normal                       samplerep-0      2d1h
    

    TimesTenオペレータは、samplenorepオブジェクトをManualInterventionRequired状態にしました。

  5. TimesTenオペレータがsamplenorepオブジェクトの各ポッドをManualInterventionRequired状態にしたことを確認します。
    kubectl get events

    出力は次のようになります。表示されているのは、出力の一部です。

    LAST SEEN   TYPE      REASON        OBJECT                           MESSAGE
    11m         Normal    StateChange   timestenclassic/samplenorep      Pod samplenorep-0 state was Normal, now ManualInterventionRequired
    11m         Normal    StateChange   timestenclassic/samplenorep      Pod samplenorep-1 state was Normal, now ManualInterventionRequired
    11m         Normal    StateChange   timestenclassic/samplenorep      Pod samplenorep-2 state was Normal, now ManualInterventionRequired
    11m         Normal    StateChange   timestenclassic/samplenorep      TimesTenClassic was AllReplicasReady, now ManualInterventionRequired

    TimesTenオペレータは、ポッドをManualInterventionRequired状態に正常にしました。

  6. samplenorepオブジェクトの管理を停止するようにTimesTenオペレータに指示します。
    1. kubectl editコマンドを使用して、オブジェクトを編集します。

      ファイル内に.spec.ttspec.stopManagingの行がある場合は、その値を変更します。現在の値と異なる必要があります。行がない場合は、行を追加して値を指定します。

      この例では、.spec.ttspec.stopManagingデータ項目を追加し、値をstopManagingNowに設定します。

      kubectl edit ttc samplerep
      
      # 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
      metadata:
      ...
      spec:
        ttspec:
          additionalMemoryRequest: 2Gi
          automaticMemoryRequests: true
          cacheCleanup: true
          createASReadinessProbe: true
          daemonLogCPURequest: 200m
          daemonLogMemoryRequest: 200Mi
          stopManaging: stopManagingNow
      ...
    2. ファイルを保存して閉じます。
  7. samplerepオブジェクトがManualInterventionRequired状態であることを確認します。
    kubectl get ttc

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

    NAME             STATE                        ACTIVE           AGE
    samplenorep      ManualInterventionRequired   N/A              2d
    samplerep        ManualInterventionRequired   samplerep-0      2d1h

    TimesTenオペレータは、samplerepオブジェクトをManualInterventionRequired状態にしました。

TimesTenClassicオブジェクトをManualInterventionRequired状態にするように、TimesTenオペレータに正常に指示しました。TimesTenオペレータは、オブジェクトの監視や管理を実行しなくなります。オブジェクトまたはそのポッドに対してこれ以降の処理は実行されません。これで、TimesTenデータベースで手動操作を実行できます。TimesTenオペレータが1つまたは両方のオブジェクトの管理を再開する準備ができたら、次の手順を実行します: