[CASSANDRA] Add Reaper and Stargate label checked by SDC/AAI 55/136155/4
authorAndreas Geissler <andreas-geissler@telekom.de>
Thu, 12 Oct 2023 11:10:53 +0000 (13:10 +0200)
committerAndreas Geissler <andreas-geissler@telekom.de>
Wed, 18 Oct 2023 12:56:44 +0000 (14:56 +0200)
Schema creations of Reaper and AAI/SDC can conflict with each
other. Therefor the reaper init script should finish before
AAI and SDC schema init scripts are started
Update jvm options for cassandra instance

Issue-ID: OOM-3246

Change-Id: I16cea161fc8b75e15c76c4cbe4851739782dfb06
Signed-off-by: Andreas Geissler <andreas-geissler@telekom.de>
kubernetes/aai/components/aai-graphadmin/templates/job-copy-db-backup.yaml
kubernetes/aai/components/aai-graphadmin/templates/job-create-db.yaml
kubernetes/aai/components/aai-graphadmin/templates/job-migration.yaml
kubernetes/aai/components/aai-graphadmin/values.yaml
kubernetes/common/cassandra/values.yaml
kubernetes/common/common/templates/_cassOp.tpl
kubernetes/sdc/components/sdc-cs/templates/job.yaml

index 865dfe3..2bee19f 100644 (file)
@@ -64,7 +64,11 @@ spec:
       - command:
         - /bin/bash
         - -c
+        {{- if .Values.global.cassandra.useOperator }}
+        - /app/ready.py --app-name aai-cassandra-reaper --timeout 1 || /app/ready.py --app-name cassandra-reaper
+        {{- else }}
         - /app/ready.py --app-name aai-cassandra --timeout 1 || /app/ready.py --app-name cassandra
+        {{- end }}
         env:
         - name: NAMESPACE
           valueFrom:
index 1a81249..c80d348 100644 (file)
@@ -60,9 +60,9 @@ spec:
         args:
         - --app-name
         {{- if .Values.global.cassandra.localCluster }}
-        - aai-cassandra
+        - {{ ternary "aai-cassandra-reaper" "aai-cassandra" .Values.global.cassandra.useOperator }}
         {{- else }}
-        - cassandra
+        - {{ ternary "cassandra-reaper" "cassandra" .Values.global.cassandra.useOperator }}
         {{- end }}
         - --container-name
         - aai-schema-service
index bf3279f..b2bc0e7 100644 (file)
@@ -65,9 +65,9 @@ spec:
         args:
         - --app-name
         {{- if .Values.global.cassandra.localCluster }}
-        - aai-cassandra
+        - {{ ternary "aai-cassandra-reaper" "aai-cassandra" .Values.global.cassandra.useOperator }}
         {{- else }}
-        - cassandra
+        - {{ ternary "cassandra-reaper" "cassandra" .Values.global.cassandra.useOperator }}
         {{- end }}
         - --container-name
         - aai-schema-service
index 5105174..e75d4df 100644 (file)
@@ -28,6 +28,8 @@ global: # global defaults
   cassandra:
     #This will instantiate AAI cassandra cluster, default:shared cassandra.
     localCluster: false
+    # flag to enable the DB creation via k8ssandra-operator
+    useOperator: true
   initContainers:
     enabled: true
   jobs:
index 930fe9b..eef716e 100644 (file)
@@ -41,7 +41,8 @@ k8ssandraOperator:
     casOptions:
       authorizer: AllowAllAuthorizer
     jvmOptions:
-      heapSize: 512M
+      heap_initial_size: 512M
+      heap_max_size: 4096M
     hostNetwork: false
   datacenters:
     - name: dc1
index d0f2387..3ea3ff1 100644 (file)
@@ -24,16 +24,26 @@ metadata:
   name: {{ .Values.k8ssandraOperator.config.clusterName }}
 spec:
   reaper:
+    initContainerImage:
+      registry: {{ include "repositoryGenerator.dockerHubRepository" . }}
     containerImage:
       registry: {{ include "repositoryGenerator.dockerHubRepository" . }}
     autoScheduling:
       enabled: true
+    metadata:
+      commonLabels:
+        app: {{ .Values.k8ssandraOperator.config.clusterName }}-reaper
+        version: {{ .Values.k8ssandraOperator.cassandraVersion }}
   stargate:
     containerImage:
       registry: {{ include "repositoryGenerator.dockerHubRepository" . }}
       tag: {{ .Values.k8ssandraOperator.stargate.tag }}
     size: {{ .Values.k8ssandraOperator.stargate.size }}
     heapSize: {{ .Values.k8ssandraOperator.stargate.jvmOptions.heapSize }}
+    metadata:
+      commonLabels:
+        app: {{ .Values.k8ssandraOperator.config.clusterName }}-stargate
+        version: {{ .Values.k8ssandraOperator.cassandraVersion }}
     livenessProbe:
       initialDelaySeconds: 200
       periodSeconds: 10
index 3738ff4..8082054 100644 (file)
@@ -36,9 +36,9 @@ spec:
         args:
         - --app-name
         {{- if .Values.global.sdc_cassandra.localCluster }}
-        - sdc-cs
+        - {{ ternary "sdc-cs-reaper" "sdc-cs" .Values.global.sdc_cassandra.useOperator }}
         {{- else }}
-        - cassandra
+        - {{ ternary "cassandra-reaper" "cassandra" .Values.global.sdc_cassandra.useOperator }}
         {{- end }}
         - "-t"
         - "15"