11 The TimesTenClassic Object Type

This chapter describes the TimesTenClassic object type. You create objects of this type in order to create active standby pairs of TimesTen databases.

Topics:

Overview of the TimesTenClassic object type

The installation of the TimesTen Operator adds a new type of object to the Kubernetes cluster. You can create as many TimesTenClassic objects as you like. Each such object creates a pair of TimesTen databases, each running in a container, inside a Pod. Both Pods operate under the control of a StatefulSet.

The definition of the TimesTenClassic object type uses the same basic format as the formal Kubernetes documentation uses to define objects that are built-in to Kubernetes. Note that the facilities available in any given Kubernetes cluster depend on what release of Kubernetes the cluster is using. For information on the Kubernetes API documentation, see:

https://kubernetes.io/docs/reference/kubernetes-api/

The Kuberenetes API reference documentation refers to a number of built-in Kubernetes types used in the definition of the TimesTenClassic object type, in particular the StatefulSet. In addition, since TimesTenClassic is basically a wrapper around a StatefulSet, its definition is particularly relevant. In particular, StatefulSetSpec is used as is. It describes the spec for the StatefulSet. It is how creators of StatefulSets express what they want the StatefulSet to look like. For more information, see:

https://kubernetes.io/docs/reference/kubernetes-api/

Note:

All metadata is passed from the TimesTenClassic object to the StatefulSet.

The TimesTenClassic object type

The TimesTenClassic object type is defined using the following object definitions. These definitions are represented in table format. The first column includes the name of the field and the type. The second column provides a description.

TimesTenClassic

You create an object of type TimesTenClassic in order to create your active standby pair of TimesTen databases.

Table 11-1, "TimesTenClassic" shows the syntax for TimesTenClassic.

Table 11-1 TimesTenClassic

Field Description

apiVersion
string

apiVersion defines the versioned schema of this representation of an object.

The value must be timesten.oracle.com/v1.

kind
string

kind indicates the type of object (in this example, TimesTenClassic)

metadata
ObjectMeta

metadata indicates the metadata about the object, such as its name. For information on ObjectMeta, see:

https://kubernetes.io/docs/reference/kubernetes-api/

spec
TimesTenClassicSpec

spec defines the desired configuration of TimesTen Pods and databases.

status
TimesTenClassicStatus

status indicates the current status of the Pods in this TimesTenClassic object as well as the status of various TimesTen components within those Pods. This data may be out of date by some window of time.


TimesTenClassicSpec

TimesTenClassicSpec appears in TimesTenClassic. See Table 11-1, "TimesTenClassic" for information.

Table 11-2, "TimesTenClassicSpec" shows the syntax for TimesTenClassicSpec.

Table 11-2 TimesTenClassicSpec

Field Description

ttspec
TimesTenClassicSpecSpec

ttspec defines the TimesTen specific attributes.

template
PodTemplateSpec

template describes the Pod that is created if insufficient replicas are detected. Each Pod that is provisioned fulfills this template, but has a unique identity from the rest. There are two additional containers, named tt and daemonlog, that are automatically included in each Pod in addition to any specified here. TimesTen runs in the tt container. For information on PodTemplateSpec, see:

https://kubernetes.io/docs/reference/kubernetes-api/

volumeClaimTemplates
PersistentVolumeClaim

TimesTen automatically provisions PersistentVolumeClaims (PVCs) for /tt (and for /ttlog, if specified). If you have applications that are running in containers in the TimesTen Pods, and those applications require additional PVCs, specify them in this field. For information on PersistentVolumeClaim, see:

https://kubernetes.io/docs/reference/kubernetes-api/


TimesTenClassicSpecSpec

TimesTenClassicSpecSpec appears in TimesTenClassicSpec. See Table 11-2, "TimesTenClassicSpec" for information.

Table 11-3, "TimesTenClassicSpecSpec" shows the syntax for TimesTenClassicSpecSpec.

Table 11-3 TimesTenClassicSpecSpec

Field Description

agentGetTimeout
integer

agentGetTimeout specifies the time (in seconds) that the Operator waits for an https GET request to be processed by the TimesTen agent. This includes the TCP and the TLS times as well as the time it takes for the TimesTen agent to implement the GET request.

The default is 60. A value of 0 indicates that there is no timeout. If the timeout is exceeded, the Operator considers the agent to be down.

agentPostTimeout
integer

agentPostTimeout specifies the time (in seconds) that the Operator waits for an https POST request to be processed by the TimesTen agent. This includes the TCP and the TLS times as well as the time it takes for the TimesTen agent to implement the POST request. Note that POST requests may take a long time and the time may be proportional to the size of the database. (An example is a POST request to duplicate a database from the active to the standby.)

The default is 600. A value of 0 indicates that there is no timeout. If the timeout is exceeded, the Operator considers the POST request to have failed.

agentTCPTimeout
integer

agentTCPTimeout specifies the time (in seconds) that the Operator waits for a TCP handshake when communicating with the TimesTen agent.

The default is 10. A value of 0 indicates that there is no timeout. If the timeout is exceeded, the Operator considers the agent to be down.

agentTLSTimeout
integer

agentTLSTimeout specifies the time (in seconds) that the Operator waits for a TLS (https) credential exchange when communicating with the TimesTen agent.

The default is 10. A value of 0 indicates that there is no timeout. If the timeout is exceeded, the Operator considers the agent to be down.

bothDownBehavior
string

If the TimesTenClassic object enters the BothDown state, the Operator examines the bothDownBehavior setting to determine what to do. Acceptable values are Best (default) or Manual. See "BothDown" for more information on the BothDown state.

cacheCleanup
boolean

cacheCleanup specifies if the metadata in the Oracle Database should be cleaned up when this TimesTenClassic object is deleted. Use for TimesTen Cache only.

Valid values:

  • true (or not specified): The metadata is cleaned up.

  • false: The metadata is not cleaned up.

See "Cleaning up the cache metadata on the Oracle Database" in this book for details. Also, see "Dropping Oracle Database objects used by autorefresh cache groups" in the Oracle TimesTen Application-Tier Database Cache User's Guide.

daemonLogSidecar
boolean

daemonLogSidecar specifies whether a daemon log container is created in each TimesTen Pod. This container writes the TimesTen daemon logs (from ttmesg.log) to stdout, thus causing Kubernetes to log them.

Valid values:

  • true (or not specified): A daemon log container is created.

  • false: A daemon log container is not created.

dbConfigMap
array of strings

dbConfigMap specifies the names of one or more ConfigMaps that will be included in a ProjectedVolume. This ProjectedVolume is mounted as /ttconfig in the TimesTen containers. If you do not specify dbConfigMap or dbSecret (explained below), you must create the required files that need to be located in /ttconfig using other means. See "Populating the /ttconfig directory" for details.

dbSecret
array of strings

dbSecret specifies the names of one or more Secrets that will be included in a ProjectedVolume. This ProjectedVolume is mounted as /ttconfig in the TimesTen containers. If you do not specify dbSecret or dbConfigMap (explained above), you must create the required files that need to be located in /ttconfig using other means. See "Populating the /ttconfig directory" for details.

image
string

image defines the image containing TimesTen.

There is no default. You must specify the name of the image.

imagePullPolicy
string

imagePullPolicy determines if and when Kubernetes pulls the TimesTen image from the image repository.

Valid values:

  • Always

  • IfNotPresent (default)

  • Never

Note: Values are case sensitive.

imagePullSecret
string

imagePullSecret defines the image pull secret that Kerbernetes should use to fetch the TimesTen image.

There is no default. You must specify the name of the image pull secret.

imageUpgradeStrategy
string

imageUpgradeStrategy specifies whether the Operator performs automated upgrades.

Valid values:

  • auto (or not specified): The Operator performs automated upgrades.

  • manual: The Operator does not perform an automated upgrade.

Values are case sensitive. See Chapter 10, "Performing Upgrades" for information.

logStorageClassName
string

logStorageClassName indicates the name of the storage class that is used to allocate PersistentVolumes to hold the TimesTen transaction logs. If you do not specify this field, the transaction logs are located in the PersistentVolumes defined by Kubernetes.

logStorageSelector
metav1.LabelSelector

When choosing to use a persistent volume to store the TimesTen transaction logs, the primary determinant of what volumes to use is the logStorageClassName element that you specify. You can optionally specify a label selector by using the logStorageSelector element. This label selector further filters the set of volumes. See:

https://kubernetes.io/docs/concepts/storage/persistent-volumes/#selector

logStorageSize
string

logStorageSize is the amount of storage that should be requested for each Pod to hold the TimesTen transaction logs. See "Storage provisioning for TimesTen" in the Oracle TimesTen In-Memory Database Operations Guide for information on determining the amount of storage needed for the transaction log files.

The default is 50G. This default value may be suitable when you are experimenting with the product or using it for demonstration purposes. However, in a production environment, consider choosing a value greater than 50G. The examples in this book assume a production environment and use a value of 250G.

pollingInterval
integer

pollingInterval specifies how often (expressed in seconds) that the Operator checks the status of the TimesTenClassic active standby pair object. For example, if you set this value to 10, the Operator checks the status of the TimesTenClassic object every ten seconds.

This value interacts with unreachableTimeout. The pollingInterval value should be smaller than the unreachableTimeout value.

The value must be a positive integer (greater than 0). The default is 5.

reexamine
string

When a TimesTenClassic object is in the ManualInterventionRequired state, the Operator examines the reexamine value every pollingInterval seconds. If the value has changed since the last iteration for this object, the Operator examines the state of the TimesTen containers for this object. See "Understanding the ManualInterventionRequired state" and "Bringing up one database" for more information.

repCreateStatement
string

The repReturnServiceAttribute and the repStoreAttribute syntax elements provide some control over the CREATE ACTIVE STANDBY statement that you use to configure your active standby pair replication scheme. However, these elements do not provide a mechanism to set all the replication options.

The repCreateStatement syntax element provides more control over the active standby pair replication configuration. If you choose to define a replication scheme, you must choose either the repCreateStatement approach or the repReturnServiceAttribute and the repStoreAttribute approach. You cannot use both approaches simultaneously in a single TimesTenClassic object definition. For example, you cannot use the repCreateStatement element and the repReturnServiceAttribute element in a single TimesTenClassic object definition. However, you can use the repReturnServiceAttribute and the repStoreAttribute elements in a single TimesTenClassic object definition.

Example of using the repCreateStatement element:

apiVersion: timesten.oracle.com/v1
kind: TimesTenClassic
metadata:
 name: sample
spec:
  ttspec:
 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 10 TIMEOUT 5 
        DISABLE RETURN ALL 10
      store "{{tt-name}}" on "{{tt-node-1}}"
        PORT {{tt-rep-port}} FAILTHRESHOLD 10 TIMEOUT 5 
        DISABLE RETURN ALL 10

The Operator does the substitutions for you.

  • {{tt-name}}: The name of the TimesTenClassic object. (For example, sample.)

  • {{tt-node-0}}: The fully qualified DNS name of the -0 Pod for the TimesTenClassic object. (For example, sample-0.sample.mynamespace.svc.cluster.local.)

  • {{tt-node-1}}: The fully qualified DNS name of the -1 Pod for the TimesTenClassic object. (For example, sample-1.sample.mynamespace.svc.cluster.local.)

  • {{tt-rep-port}}: The TCP port either chosen by the Operator or specified in the repPort CRD syntax element.

When you use the repCreateStatement element, you have nearly complete control over the replication configuration. The Operator executes the statement you define (after substituting a number of values into it). Since the Operator is using the CREATE statement that you define, ensure that the statement you specify is correct and appropriate. If the creation of your active standby pair replication scheme fails, your TimesTenClassic object transitions from the Initializing state to the Failed state. You must then delete the TimesTenClassic object to clean up the resources it holds. See "Monitoring the health of the active standby pair of databases" for information on these states.

Restrictions on the configuration:

  • You must configure an active standby pair.

  • You may not configure subscribers.

See "CREATE ACTIVE STANDBY PAIR" in the Oracle TimesTen In-Memory Database SQL Reference and "Defining an active standby pair replication scheme" in the Oracle TimesTen In-Memory Database Replication Guide for information.

replicationCipherSuite
string

replicationCipherSuite specifies the encryption algorithm to be used by TimesTen replication. If not specified, replication traffic is not encrypted.

You can specify either one of these values or both:

  • SSL_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256

  • SSL_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384

See "About using certificates with TimesTen" in the Oracle TimesTen In-Memory Database Security Guide for more information.

replicationSSLMandatory
integer

replicationSSLMandatory specifies whether SSL encryption is mandatory for replication.

Valid values:

  • 0 (or not specified): SSL encryption is not mandatory for replication.

  • 1: SSL encryption is mandatory for replication.

This value is only examined if replicationCipherSuite is specified.

See "About using certificates with TimesTen" in the Oracle TimesTen In-Memory Database Security Guide for more information.

repPort
integer

RepPort specifies the TCP port to be used for replication. The default is 4444.

repReturnServiceAttribute
string

You can use the repReturnServiceAttribute element to specify the ReturnServiceAttribute clause. This clause is part of the syntax for the CREATE ACTIVE STANDBY PAIR statement. The information you specify is included in your active standby pair's CREATE ACTIVE STANDBY PAIR statement by the Operator. Do not specify the repReturnServiceAttribute element if you have specified the repCreateStatement element.

If you do not specify the repReturnServiceAttribute element (or the repCreateStatement element), the default is NO RETURN.

See "CREATE ACTIVE STANDBY PAIR" in the Oracle TimesTen In-Memory Database SQL Reference and "Defining an active standby pair replication scheme" in the Oracle TimesTen In-Memory Database Replication Guide for information on the CREATE ACTIVE STANDBY PAIR statement and the ReturnServiceAttribute clause.

repStoreAttribute
string

You can use the repStoreAttribute element to specify the StoreAttribute clause. This clause is part of the CREATE ACTIVE STANDBY PAIR statement. The information you specify is included in your active standby pair's CREATE ACTIVE STANDBY PAIR statement by the Operator. Do not specify the repStoreAttribute element if you have specified the repCreateStatement element.

If you do not specify the repStoreAttribute element (or the repCreateStatement element), the default is: PORT repPort FAILTHRESHOLD 0.

If you specify the repStoreAttribute, you must specify the port. This port is used by replication. The port must match the port provided in the repPort element (or must match the default value if repPort is not specified). If the ports do not match, the TimesTenClassic object enters the Failed state.

See "CREATE ACTIVE STANDBY PAIR" in the Oracle TimesTen In-Memory Database SQL Reference and "Defining an active standby pair replication scheme" in the Oracle TimesTen In-Memory Database Replication Guide for information on the CREATE ACTIVE STANDBY PAIR statement and the StoreAttribute clause.

stopManaging
string

If you change the value of stopManaging for the TimesTenClassic object, the Operator places the object in the ManualInterventionRequired state. See "Understanding the ManualInterventionRequired state" and "Bringing up one database" for more information.

storageClassName
string

storageClassName indicates the name of the storage class that is used to allocate PersistentVolumes defined by Kubernetes.

There is no default. You must specify the name of the storage class.

storageSelector
metav1.LabelSelector

When choosing to use a persistent volume to store a TimesTen database, the primary determinant of what volumes to use is the storageClassName element that you specify. You can optionally specify a label selector by using the storageSelector element. This label selector further filters the set of volumes. See:

https://kubernetes.io/docs/concepts/storage/persistent-volumes/#selector

storageSize
string

storageSize is the amount of storage that should be requested for each Pod to hold TimesTen. See "Storage provisioning for TimesTen" in the Oracle TimesTen In-Memory Database Operations Guide for information on determining the amount of storage needed for TimesTen.

The default is 50G. This default value may be suitable when you are experimenting with the product or using it for demonstration purposes. However, in a production environment, consider choosing a value greater than 50G. The examples in this book assume a production environment and use a value of 250G.

unreachableTimeout
integer

unreachableTimeout specifies the number of seconds that a TimesTen instance or TimesTen database is unavailable before the Operator takes action to fail over or otherwise recover from the issue.

This value interacts with pollingInterval. The pollingInterval value should be smaller than the unreachableTimeout value.

The value must be a positive integer (greater than 0). The default is 30.

upgradeDownPodTimeout
integer

During an automated upgrade of TimesTen, the Operator deletes Pods. After deleting a Pod, the Operator waits up to the value of upgradeDownPodTimeout for the Pod to come back up. If the TimesTen agent located in the tt container of the Pod cannot be reached before this timeout, the TimesTenClassic object enter the ManualInterventionRequired state.

The value is expressed in seconds. The default is 600.

A value of 0 indicates no timeout. The TimesTenClassic object waits forever and does not enter the ManualInterventionRequired state.

See Chapter 10, "Performing Upgrades" for more information on the upgrade process.

waitingForActiveTimeout
integerca

This setting specifies the maximum amount of seconds that the TimesTenClassic object remains in the WaitingForActive state. After this period of time, if the TimesTenClassic object is still in the WaitingForActive state, it transitions to the ManualInterventionRequired state.

The default is 0 (which means there is no timeout. The TimesTenClassic object waits forever, if required).

See "Monitoring the health of the active standby pair of databases" for information on the WaitingForActive and the ManualInterventionRequired states.


TimesTenClassicStatus

TimesTenClassicStatus appears in TimesTenClassic. See "TimesTenClassic" for information. This object type is a standard part of any CRD. The Operator stores various persistent information in TimesTenClassicStatus.

The status is displayed as part of the output of the kubectl get and kubectl describe commands.

Information in TimesTenClassicStatus includes:

  • awtBehindMb: This field is only present if AWT (Asynchronous WriteThrough) is in use. The field represents how many megabytes of log is present in TimesTen that has not yet been pushed to Oracle Database. See "Overview of cache groups" in the Oracle TimesTen Application-Tier Database Cache User's Guide for more information on AWT cache groups.

  • High Level State of the Active Standby Pair: This is a string that describes the high level state of the active standby pair.

  • Detailed state of TimesTen in each Pod, including:

    • Is the TimesTen agent running?

    • Is the TimesTen main daemon running?

    • Is the TimesTen replication agent running?

    • Is the TimesTen cache agent running?

    • Is there a database in the instance?

    • Is the database loaded?

    • Is the database updatable or read only?

    • Is there a replication scheme in the database?

    • What is the replication state of this database?

    • What does this database think the replication state of its peer is?

    • What is the role for TimesTen in this Pod (active or standby)?

    • What is the high level state of the Pod?

Note:

Unknown values can occur if, for example, the agent is not running or a Pod is unavailable.