Merge "Unable to boot SNDC pod without AAF"
[oom.git] / kubernetes / policy / charts / drools / templates / statefulset.yaml
index beacbab..dd813b4 100644 (file)
@@ -13,7 +13,7 @@
 # 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" . }}
@@ -21,7 +21,7 @@ metadata:
   labels:
     app: {{ include "common.name" . }}
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
+    release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 spec:
   serviceName: {{ include "common.servicename" . }}
@@ -33,14 +33,14 @@ spec:
     metadata:
       labels:
         app: {{ include "common.name" . }}
-        release: {{ .Release.Name }}
+        release: {{ include "common.release" . }}
     spec:
       initContainers:
       - command:
         - /root/ready.py
         args:
         - --container-name
-        - {{ .Values.global.mariadb.nameOverride }}
+        - {{ include "common.release" . }}-galera-config
         - --container-name
         - {{ .Values.global.nexus.nameOverride }}
         env:
@@ -74,19 +74,24 @@ spec:
           env:
           - name: REPLICAS
             value: "{{ .Values.replicaCount }}"
+          - name: SQL_USER
+            {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
+          - name: SQL_PASSWORD
+            {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
           volumeMounts:
           - mountPath: /etc/localtime
             name: localtime
             readOnly: true
-          - mountPath: /tmp/policy-install/config/feature-healthcheck.conf
+          {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }}
+          - mountPath: /tmp/policy-install/config/{{ base $path }}
             name: drools-secret
-            subPath: feature-healthcheck.conf
-          - mountPath: /tmp/policy-install/config/feature-pooling-dmaap.conf
-            name: drools-config
-            subPath: feature-pooling-dmaap.conf
-          - mountPath: /tmp/policy-install/config/base.conf
+            subPath: {{ base $path }}
+          {{- end }}
+          {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }}
+          - mountPath: /tmp/policy-install/config/{{ base $path }}
             name: drools-config
-            subPath: base.conf
+            subPath: {{ base $path }}
+          {{- end }}
           - mountPath: /var/log/onap
             name: policy-logs
           resources:
@@ -116,7 +121,7 @@ spec:
             path: /etc/localtime
         - name: filebeat-conf
           configMap:
-            name: {{ .Release.Name }}-filebeat-configmap
+            name: {{ include "common.release" . }}-filebeat-configmap
         - name: policy-logs
           emptyDir: {}
         - name: policy-data-filebeat
@@ -125,18 +130,19 @@ spec:
           configMap:
             name: {{ include "common.fullname" . }}-configmap
             items:
-            - key: base.conf
-              path: base.conf
-              mode: 0755
-            - key: feature-pooling-dmaap.conf
-              path: feature-pooling-dmaap.conf
+            {{- range $path, $bytes := .Files.Glob "resources/configmaps/*" }}
+            - key: {{ base $path }}
+              path: {{ base $path }}
               mode: 0755
+            {{- end }}
         - name: drools-secret
           secret:
             secretName: {{ include "common.fullname" . }}-secret
             items:
-            - key: feature-healthcheck.conf
-              path: feature-healthcheck.conf
+            {{- range $path, $bytes := .Files.Glob "resources/secrets/*" }}
+            - key: {{ base $path }}
+              path: {{ base $path }}
               mode: 0644
+            {{- end }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"