[CASSANDRA] Add Reaper and Stargate label checked by SDC/AAI

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>
diff --git a/kubernetes/aai/components/aai-graphadmin/templates/job-copy-db-backup.yaml b/kubernetes/aai/components/aai-graphadmin/templates/job-copy-db-backup.yaml
index 865dfe3..2bee19f 100644
--- a/kubernetes/aai/components/aai-graphadmin/templates/job-copy-db-backup.yaml
+++ b/kubernetes/aai/components/aai-graphadmin/templates/job-copy-db-backup.yaml
@@ -64,7 +64,11 @@
       - 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:
diff --git a/kubernetes/aai/components/aai-graphadmin/templates/job-create-db.yaml b/kubernetes/aai/components/aai-graphadmin/templates/job-create-db.yaml
index 1a81249..c80d348 100644
--- a/kubernetes/aai/components/aai-graphadmin/templates/job-create-db.yaml
+++ b/kubernetes/aai/components/aai-graphadmin/templates/job-create-db.yaml
@@ -60,9 +60,9 @@
         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
diff --git a/kubernetes/aai/components/aai-graphadmin/templates/job-migration.yaml b/kubernetes/aai/components/aai-graphadmin/templates/job-migration.yaml
index bf3279f..b2bc0e7 100644
--- a/kubernetes/aai/components/aai-graphadmin/templates/job-migration.yaml
+++ b/kubernetes/aai/components/aai-graphadmin/templates/job-migration.yaml
@@ -65,9 +65,9 @@
         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
diff --git a/kubernetes/aai/components/aai-graphadmin/values.yaml b/kubernetes/aai/components/aai-graphadmin/values.yaml
index 5105174..e75d4df 100644
--- a/kubernetes/aai/components/aai-graphadmin/values.yaml
+++ b/kubernetes/aai/components/aai-graphadmin/values.yaml
@@ -28,6 +28,8 @@
   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: