Approach 2: Use Templates for Requests and Limits
This approach uses a template for specifying resource requests and limits. To enable this behavior, set the .spec.ttspec.automaticMemoryRequests
datum to false
for your TimesTenClassic or TimesTenScaleout object.
In your YAML for TimesTenClassic and TimesTenScaleout objects, you can specify a template
for Pods. In this template
, you specify attributes of various containers in the Pods, including the tt
container. If you specify a template
for one or more containers, the resource requests and limits for the containers are used by Kubernetes.
TimesTen recommends that you use the ttShmSize
utility in a TimesTen instance outside of Kubernetes to determine the appropriate value for the memory
request and limit for the tt
container. You do not need to create the database.
This example assumes you have created a TimesTen instance outside of Kubernetes and have created a DSN in your sys.odbc.ini file
with the name database1
. Use the ttShmSize
utility based on provided values for the PermSize
, TempSize
, LogBufMB
, and Connections
connection attributes.
ttShmSize -connstr "DSN=database1;PermSize=32768;TempSize=4096;LogBufMB=1024;Connections=2048"
The required shared memory size is 39991547720 bytes.
For information about ttShmSize
, see ttShmSize in the Oracle TimesTen In-Memory Database Reference.
apiVersion: timesten.oracle.com/v1
kind: TimesTenClassic
metadata:
name: resource1
spec:
ttspec:
storageClassName: standard
storageSize: 100Gi
image: container-registry.oracle.com/timesten/timesten:22.1.1.19.0
imagePullSecret: sekret
prometheus:
insecure: true
template:
spec:
containers:
- name: tt
resources:
requests:
memory: "41Gi"
cpu: "20"
limits:
memory: "41Gi"
cpu: "20"
- name: daemonlog
resources:
requests:
memory: "30Mi"
cpu: "210"
limits:
memory: "30Mi"
cpu: "210"
- name: exporter
resources:
requests:
memory: "22Mi"
cpu: "310m"
limits:
memory: "22Mi"
cpu: "310m"
In this example, cpu
and memory
requests and limits for the tt
, daemonlog
, and exporter
containers are included in the template. These resources are specified to Kubernetes.