Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / common / common / templates / _cassOp.tpl
1 {{/*
2 # Copyright © 2022 Deutsche Telekom AG
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 */}}
16
17 {{/* Cassandra Data Center. */}}
18 {{- define "common.k8ssandraCluster" -}}
19 {{- $global := .Values.global }}
20 ---
21 apiVersion: k8ssandra.io/v1alpha1
22 kind: K8ssandraCluster
23 metadata:
24   name: {{ .Values.k8ssandraOperator.config.clusterName }}
25 spec:
26   {{ if .Values.k8ssandraOperator.reaper.enabled -}}
27   reaper:
28     initContainerImage:
29       registry: {{ include "repositoryGenerator.dockerHubRepository" . }}
30     containerImage:
31       registry: {{ include "repositoryGenerator.dockerHubRepository" . }}
32     autoScheduling:
33       enabled: true
34     metadata:
35       commonLabels:
36         app: {{ .Values.k8ssandraOperator.config.clusterName }}-reaper
37         version: {{ .Values.k8ssandraOperator.cassandraVersion }}
38     {{- if .Values.metrics.enabled }}
39     telemetry:
40       prometheus:
41         enabled: true
42       mcac:
43         enabled: false
44       cassandra:
45         endpoint:
46           address: 0.0.0.0
47     {{- end }}
48   {{- end }}
49   {{ if .Values.k8ssandraOperator.stargate.enabled -}}
50   stargate:
51     containerImage:
52       registry: {{ include "repositoryGenerator.dockerHubRepository" . }}
53       tag: {{ .Values.k8ssandraOperator.stargate.tag }}
54     size: {{ .Values.k8ssandraOperator.stargate.size }}
55     heapSize: {{ .Values.k8ssandraOperator.stargate.jvmOptions.heapSize }}
56     metadata:
57       commonLabels:
58         app: {{ .Values.k8ssandraOperator.config.clusterName }}-stargate
59         version: {{ .Values.k8ssandraOperator.cassandraVersion }}
60     livenessProbe:
61       initialDelaySeconds: 200
62       periodSeconds: 10
63       failureThreshold: 20
64       successThreshold: 1
65       timeoutSeconds: 20
66     readinessProbe:
67       initialDelaySeconds: 200
68       periodSeconds: 10
69       failureThreshold: 20
70       successThreshold: 1
71       timeoutSeconds: 20
72   {{- end }}
73   cassandra:
74     serverVersion: {{ .Values.k8ssandraOperator.cassandraVersion }}
75     storageConfig:
76       cassandraDataVolumeClaimSpec:
77         {{ if .Values.k8ssandraOperator.persistence.storageClassName -}}
78         storageClassName: {{ .Values.k8ssandraOperator.persistence.storageClassName }}
79         {{- end }}
80         accessModes:
81           - ReadWriteOnce
82         resources:
83           requests:
84             storage: {{ .Values.k8ssandraOperator.persistence.size }}
85     superuserSecretRef:
86       name: {{ include "common.fullname" . }}-{{ .Values.k8ssandraOperator.config.secretName }}
87     {{- if .Values.metrics.enabled }}
88     telemetry:
89       prometheus:
90         enabled: true
91       mcac:
92         enabled: false
93       cassandra:
94         endpoint:
95           address: 0.0.0.0
96     {{- end }}
97     config:
98       {{ if .Values.k8ssandraOperator.config.casOptions -}}
99       cassandraYaml:
100         {{ toYaml .Values.k8ssandraOperator.config.casOptions | nindent 8 }}
101       {{- end }}
102       {{ if .Values.k8ssandraOperator.config.jvmOptions -}}
103       jvmOptions:
104         {{ toYaml .Values.k8ssandraOperator.config.jvmOptions | nindent 8 }}
105       {{- end }}
106     networking:
107       hostNetwork: {{ .Values.k8ssandraOperator.config.hostNetwork }}
108     datacenters:
109       {{- range $datacenter := .Values.k8ssandraOperator.datacenters }}
110       - metadata:
111           name: {{ $datacenter.name }}
112         size: {{ $datacenter.size }}
113       {{- end }}
114     {{ if .Values.podAnnotations -}}
115     metadata:
116       pods:
117         annotations:
118           {{ toYaml .Values.podAnnotations | nindent 10 }}
119       commonLabels:
120         app: {{ .Values.k8ssandraOperator.config.clusterName }}
121         version: {{ .Values.k8ssandraOperator.cassandraVersion }}
122     {{- end }}
123 {{ end }}