Additional Configuration Options
This section discusses additional configuration options. These are optional configurations for your environment:
Persistent Storage
When you create a TimesTenClassic object, the Operator automatically creates one or two Persistent Volume Claims (PVCs) per Pod. These PVCs cause Persistent Volumes (PVs) to be allocated by Kubernetes and to be attached to the TimesTen Pods. TimesTen uses the PVs to hold the TimesTen instance and the TimesTen database. If you specify two PVCs, one PV holds the instance and the checkpoint files and the second PV holds the transaction log files.
When you create a TimesTenClassic object, you must specify storageClassName and you may specify storageSize. These attributes determine the characteristics of the Persistent Volumes. The storageClassName must be one that is provided in your Kubernetes environment. For example, in Oracle Kubernetes Environment (OKE), you may use oci-bv.
The default storage is 50Gi. Use the storageSize attribute to request a different size. A storage size of 50Gi may be adequate for demonstration purposes, but in production environments, you should consider greater storage.
TimesTen places the TimesTen installation, the instance, and the database in this storage. It is mounted in each container, in each Pod, as /tt. The TimesTen instance is located at /tt/home/timesten/instances/instance1.
-
TimesTen best practices recommends that the transaction log files associated with a TimesTen database be located on a different storage volume than the checkpoint files for the database. This provides separate paths to storage for the checkpoint and the transaction log operations. For example, you can store the transaction log files in a high performance storage, while storing the checkpoint files in a slower storage. See Locate Checkpoint and Transaction Log Files on Separate Physical Device in the Oracle TimesTen In-Memory Database Operations Guide for more information.
-
To locate the checkpoint files and the transaction log files on a separate path of storage, provide a value for a second persistent storage that is used only for the transaction log files. Use the
logStorageSizeattribute for this and control its placement by using thelogStorageClassNameattribute. This causes a second PVC to be created for each Pod, which will then be available in each container at/ttlog. (This second storage volume has a/ttlogmount point.)Here is an example:
apiVersion: timesten.oracle.com/v5 kind: TimesTenClassic metadata: name: sample spec: ttspec: storageClassName: slower storageSize: 750Gi logStorageClassName: faster logStorageSize: 200G
Additional Resource Specifications
Kubernetes supports affinity and anti-affinity settings that let applications control their placement within the Kubernetes cluster. These settings can be used to ensure all replicas do not reside on a single physical host.
You can specify affinity settings, node selectors, additional containers, tolerations, resource requirements, and other Kubernetes attributes for the TimesTen Pods and the containers within these Pods that are created by the TimesTen Operator.
In a TimesTenClassic deployment, you specify these resource specifications in the TimesTenClassic object's .spec.template datum. The TimesTen Operator passes this template to the StatefulSet. For example, when you deploy a TimesTenClassic object, the Operator configures a replicated pair of TimesTen databases that provide high availability. However, since the Operator does not control the placement of Pods, you can achieve an even greater level of high availability by controlling the placement of the TimesTen Pods. TimesTen Pods can then be available in different availability zones or are on different Kubernetes nodes. To do this, you specify the affinity option in the .spec.template datum for the TimesTenClassic object.
For information about PodTemplateSpec see, https://kubernetes.io/docs/reference/kubernetes-api/
Here is an example of specifying the affinity setting for a TimesTenClassic object.
apiVersion: timesten.oracle.com/v5 kind: TimesTenClassic metadata: name: sample spec: … template: affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 podAffinityTerm: labelSelector: matchExpressions: - key: "app" operator: In values: - ds1 topologyKey: "kubernetes.io/hostname"