- Kubernetes Operator User's Guide
- TimesTen Cache in TimesTen Scaleout Example
- Create a TimesTenScaleout Object
Create a TimesTenScaleout Object
This section creates the TimesTenScaleout object.
Perform these steps:
- 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 ofkto 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 setkto2, 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
kto2.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 containskelements (where each element is an exact copy of the other elements in the replica set). ThenReplicaSetsvalue determines the number of replicas for each StatefulSet. For example, if you setkto2, the TimesTen Operator creates two StatefulSets for the data instances. If you setnReplicaSetsto3, each StatefulSet contains three replicas, and the total number of replica sets in the database is three.This example sets
nReplicaSetsto3.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 are1or3or5.This example sets
nZookeeperto3.
Next, specify these fields:
-
name: Replacecachegridwith the name of your TimesTenClassic object. -
storageClassName: Replaceoci-bvwith the name of the storage class used to allocate PersistentVolumes to hold TimesTen. -
storageSize: Replace250Giwith 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 of250GiforstorageSize. For demonstration purposes, a value of50Giis adequate. -
image: Replacecontainer-registry.oracle.com/timesten/timesten:22.1.1.19.0with the location and name of your image. -
imagePullSecret: Replacesekretwith the image pull secret that Kubernetes should use to fetch the TimesTen image. -
dbConfigMap: This example uses one ConfigMap (calledcachegrid) 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 -
- Create the TimesTenScaleout object.
kubectl create -f cachegrid.yamlThe 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.