- 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 ofk
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 setk
to2
, 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
to2
.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 containsk
elements (where each element is an exact copy of the other elements in the replica set). ThenReplicaSets
value determines the number of replicas for each StatefulSet. For example, if you setk
to2
, the TimesTen Operator creates two StatefulSets for the data instances. If you setnReplicaSets
to3
, each StatefulSet contains three replicas, and the total number of replica sets in the database is three.This example sets
nReplicaSets
to3
.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 are1
or3
or5
.This example sets
nZookeeper
to3
.
Next, specify these fields:
-
name
: Replacecachegrid
with the name of your TimesTenClassic object. -
storageClassName
: Replaceoci-bv
with the name of the storage class used to allocate PersistentVolumes to hold TimesTen. -
storageSize
: Replace250Gi
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 of250Gi
forstorageSize
. For demonstration purposes, a value of50Gi
is adequate. -
image
: Replacecontainer-registry.oracle.com/timesten/timesten:22.1.1.19.0
with the location and name of your image. -
imagePullSecret
: Replacesekret
with 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.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.