summaryrefslogtreecommitdiffstats
path: root/kubernetes/common
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/common')
-rwxr-xr-xkubernetes/common/mariadb-init/resources/config/db_init.sh4
-rw-r--r--kubernetes/common/postgres/templates/pv-primary.yaml2
-rw-r--r--kubernetes/common/postgres/templates/pv-replica.yaml2
-rw-r--r--kubernetes/common/postgres/templates/pvc-primary.yaml5
-rw-r--r--kubernetes/common/postgres/templates/pvc-replica.yaml4
5 files changed, 15 insertions, 2 deletions
diff --git a/kubernetes/common/mariadb-init/resources/config/db_init.sh b/kubernetes/common/mariadb-init/resources/config/db_init.sh
index 8caa697e79..b2fdb14b12 100755
--- a/kubernetes/common/mariadb-init/resources/config/db_init.sh
+++ b/kubernetes/common/mariadb-init/resources/config/db_init.sh
@@ -17,8 +17,8 @@
while read DB ; do
USER_VAR="MYSQL_USER_${DB^^}"
PASS_VAR="MYSQL_PASSWORD_${DB^^}"
- USER=${USER_VAR}
- PASS=${PASS_VAR}
+ USER=${!USER_VAR}
+ PASS=${!PASS_VAR}
MYSQL_OPTS=( -h ${DB_HOST} -P ${DB_PORT} -uroot -p${MYSQL_ROOT_PASSWORD} )
echo "Creating database ${DB} and user ${USER}..."
diff --git a/kubernetes/common/postgres/templates/pv-primary.yaml b/kubernetes/common/postgres/templates/pv-primary.yaml
index 096f0c9d2b..1764868ffc 100644
--- a/kubernetes/common/postgres/templates/pv-primary.yaml
+++ b/kubernetes/common/postgres/templates/pv-primary.yaml
@@ -14,6 +14,7 @@
# # limitations under the License.
*/}}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if include "common.needPV" . -}}
kind: PersistentVolume
apiVersion: v1
metadata:
@@ -35,3 +36,4 @@ spec:
hostPath:
path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/primary
{{- end -}}
+{{- end -}}
diff --git a/kubernetes/common/postgres/templates/pv-replica.yaml b/kubernetes/common/postgres/templates/pv-replica.yaml
index a98abefba0..b67cac0c26 100644
--- a/kubernetes/common/postgres/templates/pv-replica.yaml
+++ b/kubernetes/common/postgres/templates/pv-replica.yaml
@@ -14,6 +14,7 @@
# # limitations under the License.
*/}}
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- if include "common.needPV" . -}}
kind: PersistentVolume
apiVersion: v1
metadata:
@@ -35,3 +36,4 @@ spec:
hostPath:
path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}/replica
{{- end -}}
+{{- end -}}
diff --git a/kubernetes/common/postgres/templates/pvc-primary.yaml b/kubernetes/common/postgres/templates/pvc-primary.yaml
index 05a5088966..e529da1bd5 100644
--- a/kubernetes/common/postgres/templates/pvc-primary.yaml
+++ b/kubernetes/common/postgres/templates/pvc-primary.yaml
@@ -36,5 +36,10 @@ spec:
resources:
requests:
storage: {{ .Values.persistence.size }}
+{{- if include "common.needPV" . }}
+ storageClassName: "{{ include "common.fullname" . }}-primary"
+{{- else }}
+ storageClassName: {{ include "common.storageClass" . }}
+{{- end }}
storageClassName: "{{ include "common.fullname" . }}-primary"
{{- end -}}
diff --git a/kubernetes/common/postgres/templates/pvc-replica.yaml b/kubernetes/common/postgres/templates/pvc-replica.yaml
index f740521919..41199b6861 100644
--- a/kubernetes/common/postgres/templates/pvc-replica.yaml
+++ b/kubernetes/common/postgres/templates/pvc-replica.yaml
@@ -36,5 +36,9 @@ spec:
resources:
requests:
storage: {{ .Values.persistence.size }}
+{{- if include "common.needPV" . }}
storageClassName: "{{ include "common.fullname" . }}-replica"
+{{- else }}
+ storageClassName: {{ include "common.storageClass" . }}
+{{- end }}
{{- end -}}