Merge "[CONSUL] Add limits to consul chart."
[oom.git] / kubernetes / appc / templates / statefulset.yaml
index 68e108d..5e889f1 100644 (file)
@@ -1,3 +1,4 @@
+{{/*
 # Copyright © 2018  AT&T, Amdocs, Bell Canada Intellectual Property.  All rights reserved.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,8 +12,9 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
+*/}}
 
-apiVersion: apps/v1beta1
+apiVersion: apps/v1
 kind: StatefulSet
 metadata:
   name: {{ include "common.fullname" . }}
@@ -23,6 +25,9 @@ metadata:
     release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 spec:
+  selector:
+    matchLabels:
+      app: {{ include "common.name" . }}
   serviceName: "{{ .Values.service.name }}-cluster"
   replicas: {{ .Values.replicaCount }}
   podManagementPolicy: Parallel
@@ -70,7 +75,7 @@ spec:
 
       - name: {{ include "common.name" . }}-readiness
         command:
-        - /root/ready.py
+        - /app/ready.py
         args:
         - --container-name
         - {{.Values.config.mariadbGaleraContName}}
@@ -80,7 +85,7 @@ spec:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
-        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+        image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
       - name: {{ include "common.name" . }}-chown
         image: "busybox"
@@ -185,11 +190,17 @@ spec:
             subPath: installSdncDb.sh
           - mountPath: {{ .Values.persistence.mdsalPath }}
             name: {{ include "common.fullname" . }}-data
-          - mountPath: /var/log/onap
+          - mountPath: {{ .Values.log.path }}
             name: logs
           - mountPath: /opt/onap/appc/data/org.ops4j.pax.logging.cfg
             name: log-config
             subPath: org.ops4j.pax.logging.cfg
+          - mountPath: /opt/onap/appc/data/stores/org.onap.appc.p12
+            name: p12-certs
+            subPath: org.onap.appc.p12
+          - mountPath: /opt/onap/appc/data/stores/org.onap.appc.keyfile
+            name: keyfile-certs
+            subPath: org.onap.appc.keyfile
           resources:
 {{ include "common.resources" . | indent 12 }}
        {{- if .Values.nodeSelector }}
@@ -202,31 +213,23 @@ spec:
         {{- end }}
 
         # side car containers
-        - name: filebeat-onap
-          image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
-          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          volumeMounts:
-          - mountPath: /usr/share/filebeat/filebeat.yml
-            name: filebeat-conf
-            subPath: filebeat.yml
-          - mountPath: /var/log/onap
-            name: logs
-          - mountPath: /usr/share/filebeat/data
-            name: data-filebeat
+        {{ include "common.log.sidecar" . | nindent 8 }}
       volumes:
+        - name: keyfile-certs
+          secret:
+            secretName: {{ include "common.fullname" . }}-certs
+        - name: p12-certs
+          secret:
+            secretName: {{ include "common.fullname" . }}-certs
         - name: localtime
           hostPath:
             path: /etc/localtime
-        - name: filebeat-conf
-          configMap:
-            name: {{ include "common.fullname" . }}-filebeat
         - name: log-config
           configMap:
             name: {{ include "common.fullname" . }}-logging-cfg
         - name: logs
           emptyDir: {}
-        - name: data-filebeat
-          emptyDir: {}
+        {{ include "common.log.volumes" . | nindent 8 }}
         - name: onap-appc-data-properties-input
           configMap:
             name: {{ include "common.fullname" . }}-onap-appc-data-properties