Suspend Management of a TimesTenClassic Object

These sections discuss why you may want to suspend the management of your TimesTenClassic object by the Operator and then how to do it:

About Suspending Management

The Operator periodically examines the state of the TimesTen instances and the databases associated with each TimesTenClassic object. It takes actions to repair anything that is broken. You may have a situation in which you want to manually perform maintenance operations. In such a situation, you do not want the Operator to interfere and attempt to perform repair operations.

You could stop the Operator (by deleting the Deployment of the timesten-operator). This action prevents the Operator from interfering. See "Revert to Manual Control" for more information. However, if you have more than one TimesTenClassic object and you delete the Operator, this interferes with the management of all the TimesTenClassic objects, when perhaps only one of them needs manual intervention.

Alternatively, you can direct the Operator to take no action for one TimesTenClassic object by specifying the .spec.ttspec.stopManaging datum for this TimesTenClassic object. See "TimesTenClassicSpecSpec" for more information on this element. The Operator examines the value of .spec.ttspec.stopManaging and if it has changed since the last time the Operator examined it, the Operator changes the state of the TimesTenClassic object to ManualInterventionRequired. This causes the Operator to no longer examine the status of the TimesTen Pods, the containers, the instances, and the databases associated with the TimesTenClassic object. The Operator takes no action on the object or its Pods.

When you want the Operator to manage the TimesTenClassic object again, you change the value of the .spec.ttspec.reexamine datum. See "About the ManualInterventionRequired State" for more information on the ManualInterventionRequired state and the .spec.ttspec.reexamine datum.

In this way, you can perform manual operations on TimesTen without deleting the Deployment of the timesten-operator.

Suspend Management

This example illustrates how to use the .spec.ttspec.stopManaging datum to direct the Operator to stop managing one of the TimesTenClassic objects running in your Kubernetes cluster. In this example, there are two TimesTenClassic objects (sample and sample2) that are running. There is a requirement for you to perform manual maintenance operations on the TimesTen databases associated with one of the objects (sample, in this example). You want the Operator to stop managing this sample TimesTenClassic object. However, you want the Operator to continue managing the other TimesTenClassic object (sample2, in this example).

Perform these steps:

  1. Review the Pods that are running.
    % kubectl get pods
    NAME                                        READY   STATUS    RESTARTS   AGE
    sample-0                                    2/2     Running   0          6m33s
    sample-1                                    2/2     Running   0          6m32s
    sample2-0                                   2/2     Running   0          6m32s
    sample2-1                                   2/2     Running   0          6m32s
    timesten-operator-846cb5c97c-cxbl2          1/1     Running   0          4d20h
    
  2. Confirm the sample TimesTenClassic object is in the Normal state. Recall that you want to perform maintenance on the TimesTen databases associated with this object.
    % kubectl get ttc sample
    NAME     STATE    ACTIVE     AGE
    sample   Normal   sample-0   13m
    
  3. Set the .spec.ttspec.stopManaging value. The value must be different than the current value for the TimesTenClassic object. When the Operator examines this value and notices it has changed since the last iteration, it will take appropriate action.

    Use the kubectl edit command to edit the TimesTenClassic 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 for .spec.ttspec.stopManaging in the file, then add a line and specify a value.

    In this example, there is no .spec.ttspec.stopManaging line. This example adds the .spec.ttspec.stopManaging line and sets the value for .spec.ttspec.stopManaging to April21Stop1 (represented in bold).

    Note: Not all output is shown:

    % kubectl edit timestenclassic sample
    # 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/v1
    kind: TimesTenClassic
    metadata:
    ...
      name: sample
      namespace: mynamespace
    ...
    repCreateStatement: |
      create active standby pair
        "{{tt-name}}" on "{{tt-node-0}}",
        "{{tt-name}}" on "{{tt-node-1}}"
      RETURN TWOSAFE
      store "{{tt-name}}" on "{{tt-node-0}}"
        PORT {{tt-rep-port}} FAILTHRESHOLD 0 TIMEOUT 999
      store "{{tt-name}}" on "{{tt-node-1}}"
        PORT {{tt-rep-port}} FAILTHRESHOLD 0 TIMEOUT 999
    spec:
      ttspec:
        bothDownBehavior: Best
        dbConfigMap:
        - sample
        image: container-registry.oracle.com/timesten/timesten:22.1.1.19.0
        imagePullSecret: sekret
        storageClassName: oci-bv
        storageSize: 250Gi
        stopManaging: April21Stop1
    ...
    timestenclassic.timesten.oracle.com/sample edited
    
  4. Use the kubectl get command to check the state of the sample TimesTenClassic object. Note that the sample TimesTenClassic object has transitioned to the ManualInterventionRequired state. This is the expected behavior after changing the .spec.ttspec.stopManaging value to a new value.
    % kubectl get ttc sample
    NAME     STATE                        ACTIVE     AGE
    sample   ManualInterventionRequired   sample-0   15m
    

The sample TimesTenClassic object is in the ManualInterventionRequired state. The Operator has suspended the monitoring and the management of the sample TimesTenClassic object. It will take no further action on this TimesTenClassic object or its Pods. You can now perform manual operations on your TimesTen databases. When you have completed such operations and are ready for the Operator to resume management, proceed to About Bringing Up One Database.