Suspend Management

You can instruct the TimesTen Operator to stop managing one or more TimesTenClassic objects that are running in your namespace. To do so, use the TimesTenClassic object's .spec.ttspec.stopManaging datum.

Let's look at an example.

  1. Review the TimesTenClassic objects that are running in your namespace.
    kubectl get ttc
    The output is similar to the following:
    NAME             STATE              ACTIVE           AGE
    samplenorep      AllReplicasReady   N/A              47h
    samplerep        Normal             samplerep-0      2d
    There are two TimesTenClassic objects. The samplenorep is a non-replicated object and all replicas are ready. The samplerep is a replicated object that is in the Normal state.
  2. Review the Pods.
    kubectl get pods

    The output is similar to the following:

    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

    For the samplenorep non-replicated object, there are three Pods running representing three databases (replicas=3). For the samplerep replicated object, there are two Pods running. One Pod represents the active database (samplerep-0) and one Pod represents the standby database (samplerep-1).

  3. Instruct the TimesTen Operator to stop managing the samplenorep object.
    1. Use the kubectl edit command to edit the object.

      If there is a line for .spec.ttspec.stopManaging in the file, then modify its value. It must be different than the current value. If there is no line, add a line and specify a value.

      This example adds the .spec.ttspec.stopManaging datum and sets the value to 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/v4
      kind: TimesTenClassic
      metadata:
      ...
      spec:
        ttspec:
          additionalMemoryRequest: 2Gi
          automaticMemoryRequests: true
          cacheCleanup: true
          createASReadinessProbe: true
          daemonLogCPURequest: 200m
          daemonLogMemoryRequest: 200Mi
          stopManaging: stopManagingNow
      ...
    2. Save and close the file.
  4. Confirm the samplenorep object is in the ManualInterventionRequired state.
    kubectl get ttc
    The output is similar to the following:
    NAME             STATE                        ACTIVE           AGE
    samplenorep      ManualInterventionRequired   N/A              2d
    samplerep        Normal                       samplerep-0      2d1h
    

    The TimesTen Operator moved the samplenorep object to the ManualInterventionRequired state.

  5. Confirm the TimesTen Operator moved each of the Pods for the samplenorep object to the ManualInterventionRequired state.
    kubectl get events

    The output is similar to the following. Not all output is displayed.

    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

    The TimesTen Operator successfully moved the Pods to the ManualInterventionRequired state.

  6. Instruct the TimesTen Operator to stop managing the samplenorep object.
    1. Use the kubectl edit command to edit the object.

      If there is a line for .spec.ttspec.stopManaging in the file, then modify its value. It must be different than the current value. If there is no line, add a line and specify a value.

      This example adds the .spec.ttspec.stopManaging datum and sets the value to 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/v4
      kind: TimesTenClassic
      metadata:
      ...
      spec:
        ttspec:
          additionalMemoryRequest: 2Gi
          automaticMemoryRequests: true
          cacheCleanup: true
          createASReadinessProbe: true
          daemonLogCPURequest: 200m
          daemonLogMemoryRequest: 200Mi
          stopManaging: stopManagingNow
      ...
    2. Save and close the file.
  7. Confirm the samplerep object is in the ManualInterventionRequired state.
    kubectl get ttc

    The output is similar to the following:

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

    The TimesTen Operator moved the samplerep object to the ManualInterventionRequired state.

You successfully instructed the TimesTen Operator to move TimesTenClassic objects to the ManualInterventionRequired state. The TimesTen Operator is no longer monitoring or managing the objects. It takes no further action on the objects or its Pods. You can now perform manual operations on your TimesTen databases. When you are ready for the TimesTen Operator to resume management of one or both objects, do the following: