AAF OOM 2.1.20
[oom.git] / kubernetes / aaf / charts / aaf-sms / charts / aaf-sms-vault / templates / statefulset.yaml
index b9070a1..4023106 100644 (file)
@@ -1,4 +1,5 @@
 # Copyright 2018 Intel Corporation, Inc
+# Modifications © 2020 AT&T
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -31,11 +32,27 @@ spec:
         app: {{ include "common.name" . }}
         release: {{ include "common.release" . }}
     spec:
+{{- if .Values.persistence.enabled }}
+      initContainers:
+        - name: fix-permission
+          command:
+            - /bin/sh
+          args:
+            - -c
+            - |
+              chmod -R 775 /consul/data
+              chown -R 100:1000 /consul/data
+          image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}"
+          imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+          volumeMounts:
+            - mountPath: /consul/data
+              name: {{ include "common.fullname" . }}-data
+{{- end }}
       containers:
       - image: "{{ include "common.repository" . }}/{{ .Values.image.vault }}"
         name: {{ include "common.name" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        command: ["vault","server","-config","/vault/config/config.json"]
+        args: ["server"]
         ports:
         - containerPort: {{ .Values.service.internalPort }}
         volumeMounts:
@@ -50,7 +67,7 @@ spec:
       - image: "{{ include "common.repository" . }}/{{ .Values.image.consul }}"
         name: {{ include "common.name" . }}-backend
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        command: ["consul","agent","-server","-client","0.0.0.0","-bootstrap-expect=1","-config-file","/consul/config/config.json"]
+        args: ["agent","-server","-bind","0.0.0.0","-bootstrap-expect=1","-config-file","/consul/config/config.json"]
         ports:
         - name: http
           containerPort: 8500