About the operator.yaml File
TimesTen provides the operator.yaml
YAML manifest file in its container image. You use the operator.yaml
YAML manifest file to install the TimesTen Operator into your namespace. The file contains the YAML specification of a Kubernetes Deployment. The Deployment causes Kubernetes to create one or more Pods, each of which runs the TimesTen Operator.
TimesTen runs in a TimesTen Operator Pod's container. You need to specify the TimesTen container image, container registry, and image pull secret that you are using for the TimesTen Operator. The operator.yaml
file provides the following settings. Change them to fit your environment:
-
image
:container-registry.oracle.com/timesten/timesten:latest
The value for
image
is the latest official TimesTen container image oncontainer-registry.oracle.com
.For more information about obtaining TimesTen container images and choosing a container registry, see Prepare to Use the TimesTen Kubernetes Operator.
-
imagePullSecrets
:sekret
In the
operator.yaml
file, the image pull secret is the Kubernetes Secret that Kubernetes uses to pull a TimesTen container image from your container registry. For more information about creating image pull secrets, see Prepare to Use the TimesTen Kubernetes Operator.
Let's review the attibutes of the operator.yaml
file, some of which you can customize to fit your environment.
operator.yaml
file. This file can change from release to release.vi operator.yaml
# Copyright (c) 2019 - 2024, Oracle and/or its affiliates.
apiVersion: apps/v1
kind: Deployment
metadata:
name: timesten-operator
spec:
replicas: 1
selector:
matchLabels:
name: timesten-operator
template:
metadata:
labels:
name: timesten-operator
spec:
serviceAccountName: timesten-operator
imagePullSecrets:
- name: sekret
containers:
- name: timesten-operator
image: container-registry.oracle.com/timesten/timesten:latest
command:
- /timesten/operator/operator/timesten-operator
ports:
- name: probes
containerPort: 8081
protocol: TCP
- name: metrics
containerPort: 8080
protocol: TCP
readinessProbe:
httpGet:
scheme: HTTP
path: /healthz
port: probes
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 1
livenessProbe:
httpGet:
scheme: HTTP
path: /healthz
port: probes
initialDelaySeconds: 10
periodSeconds: 30
timeoutSeconds: 10
successThreshold: 1
failureThreshold: 3
env:
- name: WATCH_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: "timesten-operator"
- name: TT_MAX_RECONCILES
value: "2"
- name: EXPOSE_METRICS
value: "1"
- name: METRICS_SCHEME
value: "https"
- name: EXPOSE_PROBES
value: "1"
- name: CREATE_SERVICEMONITOR
value: "1"
resources:
requests:
cpu: "250m"
memory: "1G"
limits:
cpu: "250m"
memory: "1G"
securityContext:
runAsNonRoot: true
privileged: false
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
capabilities:
drop:
- all
volumeMounts:
- name: tmp
mountPath: /tmp
volumes:
- name: tmp
emptyDir: {}
# An example affinity definition; this pod will only be assigned to a node
# running on amd64 (the default)
#
# affinity:
# nodeAffinity:
# requiredDuringSchedulingIgnoredDuringExecution:
# nodeSelectorTerms:
# - matchExpressions:
# - key: "kubernetes.io/arch"
# operator: In
# values: ["amd64"]
-
Deployment
: Theoperator.yaml
file instructs Kubernetes to install the TimesTen Operator as a Deployment. You cannot change this setting. -
timesten-operator
: The name of the TimesTen Operator istimesten-operator
. You cannot change this setting. -
replicas
:1
The
replicas
attribute indicates the number of copies of the TimesTen Operator. You can have more than one copy of the TimesTen Operator. The default value of1
indicates there is one TimesTen Operator. A value of1
is acceptable for development and testing. However, you can specify more than one replica for high availability purposes.Note:
TimesTen Operator metrics are accurate when you have one TimesTen Operator defined in your TimesTen Operator Deployment. For more information about exposing TimesTen Operator metrics, see Expose Metrics from the TimesTen Kubernetes Operator. -
imagePullSecrets
:sekret
As previously discussed, replace
sekret
with the name of the image pull secret that Kubernetes uses to pull the TimesTen container image from your container registry. -
image
:container-registry.oracle.com/timesten/timesten:latest
As previously discussed, replace
container-registry.oracle.com/timesten/timesten:latest
with the name of your container registry and container image. -
readinessProbe
andlivenessProbe
: Readiness and liveness probes allow Kubernetes to determine the health of the TimesTen Operator. See About Readiness and Liveness Probes. -
The TimesTen Operator automatically exposes metrics about its own functionality and the status of TimesTenClassic objects to Prometheus or another scraping mechanism. The following environment variables are specific to TimesTen Operator metrics.:
-
EXPOSE_METRICS
METRICS_SCHEME
-
EXPOSE_PROBES
-
CREATE_SERVICEMONITOR
-
-
resources
: There are default CPU and memory requests and limits for the TimesTen Operator. You do not need to change these settings. -
affinity
: Theaffinity
definition is specific to deploying the TimesTen Operator in a multi-architecture Kubernetes environment. You need to uncomment this section if you are installing the TimesTen Operator in a Kubernetes cluster that contains bothamd64
andarm64
nodes. See About Deploying in a Multi-Architecture Kubernetes Cluster.