summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep Shah <sandeeplinux1068@gmail.com>2020-08-07 16:54:12 -0500
committerSandeep Shah <sandeeplinux1068@gmail.com>2020-08-18 06:00:33 -0500
commit6a385ce0bf95f6eba1686b95a2b5a624caa6ed4c (patch)
tree8a66c2ba7ffb2501c80ee6e85648c5271ae8c49f
parentb57170364c0c11db35058e876d9dbd78c0983fee (diff)
No root access to mariadb from portal app
Updates to helm charts to include an init container to set permissions for volume, so that the existing initialization code when run as a non-root user can access the volume. this is in combination with PORTAL-966. Issue-ID: PORTAL-946 Signed-off-by: SandeepLinux <Sandeep.Shah@att.com> Change-Id: I63a78dc1ab90914d648b0c1f470d3079eb0ddeba
-rw-r--r--kubernetes/portal/components/portal-mariadb/templates/deployment.yaml7
-rw-r--r--kubernetes/portal/components/portal-mariadb/values.yaml3
2 files changed, 9 insertions, 1 deletions
diff --git a/kubernetes/portal/components/portal-mariadb/templates/deployment.yaml b/kubernetes/portal/components/portal-mariadb/templates/deployment.yaml
index bcd223c7e6..ec6cc50634 100644
--- a/kubernetes/portal/components/portal-mariadb/templates/deployment.yaml
+++ b/kubernetes/portal/components/portal-mariadb/templates/deployment.yaml
@@ -34,6 +34,13 @@ spec:
app: {{ include "common.name" . }}
release: {{ include "common.release" . }}
spec:
+ initContainers:
+ - name: volume-permissions
+ image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}"
+ command: ['sh', '-c', 'chmod -R 777 /var/lib/mysql']
+ volumeMounts:
+ - mountPath: /var/lib/mysql
+ name: mariadb-data
containers:
- name: {{ include "common.name" . }}
image: "{{ include "common.repository" . }}/{{ .Values.image }}"
diff --git a/kubernetes/portal/components/portal-mariadb/values.yaml b/kubernetes/portal/components/portal-mariadb/values.yaml
index 08157f7b92..40b1775ae9 100644
--- a/kubernetes/portal/components/portal-mariadb/values.yaml
+++ b/kubernetes/portal/components/portal-mariadb/values.yaml
@@ -21,7 +21,8 @@ global: # global defaults
persistence: {}
readinessRepository: oomk8s
readinessImage: readiness-check:2.0.0
-
+ busyBoxImage: busybox:1.30
+ busyBoxRepository: docker.io
# application image
repository: nexus3.onap.org:10001