Create a TimesTenScaleout Object

This section creates the TimesTenScaleout object.

Perform these steps:

  1. Create an empty YAML file. You can choose any name, but you may want to use the same name you used for the name of the TimesTenScaleout object. (In this example, cachegrid.) See TimesTenScaleoutSpecSpec for information on the fields that you must specify in this YAML file as well as the fields that are optional.
    Specify these TimesTen Scaleout specific fields:
    • k: Set the value of k to the number of copies of data for your TimesTen database. This value determines the number of StatefulSets that the TimesTen Operator creates. A StatefulSet provides the Pods that are used to implement a single data space in the grid. For example, if you set k to 2, the Operator creates two StatefulSets. One StatefulSet provides the Pods for the data instances in data space one. The second StatefulSet provides the Pods for the data instances in data space two.

      This example sets k to 2.

      For information on K-safety and determining an appropriate value for k, see K-Safety in the Oracle TimesTen In-Memory Database Scaleout User's Guide.

    • nReplicaSets: Set the value to the number of replica sets in the grid. A replica set contains k elements (where each element is an exact copy of the other elements in the replica set). The nReplicaSets value determines the number of replicas for each StatefulSet. For example, if you set k to 2, the TimesTen Operator creates two StatefulSets for the data instances. If you set nReplicaSets to 3, each StatefulSet contains three replicas, and the total number of replica sets in the database is three.

      This example sets nReplicaSets to 3.

      For information on replica sets, see Understanding Replica Sets in the Oracle TimesTen In-Memory Database Scaleout User's Guide.

    • nZookeeper: Set the value to the number of ZooKeeper Pods to provision in a StatefulSet. Your options are 1 or 3 or 5.

      This example sets nZookeeper to 3.

    Next, specify these fields:

    • name: Replace cachegrid with the name of your TimesTenClassic object.

    • storageClassName: Replace oci-bv with the name of the storage class used to allocate PersistentVolumes to hold TimesTen.

    • storageSize: Replace 250Gi with the amount of storage that should be requested for each Pod to hold TimesTen. Note: This example assumes a production environment and uses a value of 250Gi for storageSize. For demonstration purposes, a value of 50Gi is adequate.

    • image: Replace container-registry.oracle.com/timesten/timesten:22.1.1.19.0 with the location and name of your image.

    • imagePullSecret: Replace sekret with the image pull secret that Kubernetes should use to fetch the TimesTen image.

    • dbConfigMap: This example uses one ConfigMap (called cachegrid) for the metadata files.

    vi cachetest.yaml
    
    apiVersion: timesten.oracle.com/v1
    kind: TimesTenScaleout
    metadata:
      name: cachegrid
    spec:
      ttspec:
        storageClassName: oci-bv
        storageSize: 250Gi
        image: container-registry.oracle.com/timesten/timesten:22.1.1.19.0
        imagePullSecret: sekret
        dbConfigMap:
        - cachegrid
        k: 2
        nReplicaSets: 3
        nZookeeper: 3
  2. Create the TimesTenScaleout object.
    kubectl create -f cachegrid.yaml

    The output is the following.

    timestenscaleout.timesten.oracle.com/cachegrid created

You successfully created the TimesTenScaleout object. The process of deploying your grid and associated databases begins, but is not yet complete.