diff --git a/mariadb/templates/statefulset.yaml b/mariadb/templates/statefulset.yaml index 8beab96d0..1ab707935 100644 --- a/mariadb/templates/statefulset.yaml +++ b/mariadb/templates/statefulset.yaml @@ -239,8 +239,12 @@ spec: defaultMode: 0444 {{- if not .Values.volume.enabled }} - name: mysql-data + {{- if .Values.volume.use_local_path_for_single_pod_cluster.enabled }} + hostPath: {{ .Values.volume.use_local_path_for_single_pod_cluster.host_path }} + {{- else }} emptyDir: {} {{- end }} + {{- end }} {{- if .Values.volume.enabled }} volumeClaimTemplates: - metadata: diff --git a/mariadb/values.yaml b/mariadb/values.yaml index 4a2c44bdf..48786222c 100644 --- a/mariadb/values.yaml +++ b/mariadb/values.yaml @@ -229,6 +229,11 @@ dependencies: service: oslo_db volume: + # this value is used for single pod deployments of mariadb to prevent losing all data + # if the pod is restarted + use_local_path_for_single_pod: + enabled: false + host_path: "/tmp/mysql-data" chown_on_start: true enabled: true class_name: general