Merge "vvp -- VNF Validation Platform"
[oom.git] / kubernetes / aaf / charts / aaf-cs / templates / deployment.yaml
index 15e574f..3abdcb3 100644 (file)
@@ -24,40 +24,51 @@ metadata:
     heritage: {{ .Release.Service }}
 spec:
   replicas: {{ .Values.replicaCount }}
-  selector:
-    matchLabels:
-      app: {{ include "common.name" . }}
   template:
     metadata:
       labels:
         app: {{ include "common.name" . }}
-      name: {{ .Release.Name }}
+        release: {{ .Release.Name }}
     spec:
-      hostname: {{ include "common.name" . }}
       containers:
-      - args:
+      - name: {{ include "common.name" . }}
         image: "{{ include "common.repository" . }}/{{ .Values.image }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        name: {{ include "common.name" . }}
+        command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"]
+        ports:
+        - containerPort: {{ .Values.service.externalPort }}
+        - containerPort: {{ .Values.service.externalPort2 }}
+        - containerPort: {{ .Values.service.externalPort3 }}
+        - containerPort: {{ .Values.service.externalPort4 }}
+        env:
+        - name: CASSANDRA_CLUSTER_NAME
+          value: "osaaf"
+        - name: CASSANDRA_DC
+          value: "dc1"
+        - name: HEAP_NEWSIZE
+          value: "512M"
+        - name: MAX_HEAP_SIZE
+          value: "1024M"
         volumeMounts:
-        - mountPath: /data
-          name: aaf-cs-data
-        # disable liveness probe when breakpoints set in debugger
-        # so K8s doesn't restart unresponsive container
+        - mountPath: /var/lib/cassandra
+          name: cassandra-storage
+        - mountPath: /etc/localtime
+          name: localtime
+          readOnly: true
         {{- if eq .Values.liveness.enabled true }}
         livenessProbe:
           tcpSocket:
-            port: {{ .Values.service.internalPort }}
+            port: {{ .Values.service.internalPort3 }}
           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
           periodSeconds: {{ .Values.liveness.periodSeconds }}
         {{ end -}}
         readinessProbe:
           tcpSocket:
-            port: {{ .Values.service.internalPort }}
+            port: {{ .Values.service.internalPort3 }}
           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
           periodSeconds: {{ .Values.readiness.periodSeconds }}
         resources:
-{{ toYaml .Values.resources | indent 12 }}
+{{ include "common.resources" . | indent 10 }}
       {{- if .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml .Values.nodeSelector | indent 10 }}
@@ -66,10 +77,16 @@ spec:
       affinity:
 {{ toYaml .Values.affinity | indent 10 }}
       {{- end }}
-
       volumes:
-        - name: aaf-cs-data
-          secret:
-            secretName: {{ include "common.fullname" . }}
+      - name: localtime
+        hostPath:
+          path: /etc/localtime
+      - name: cassandra-storage
+      {{- if .Values.persistence.enabled }}
+        persistentVolumeClaim:
+          claimName: {{ include "common.fullname" . }}
+      {{- else }}
+        emptyDir: {}
+      {{- end }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"