From 9ddc98746c64ca5dd980dabb04ccaa8928b4215d Mon Sep 17 00:00:00 2001 From: Jaesang Lee Date: Wed, 22 May 2019 02:17:22 +0000 Subject: [PATCH] rabbitmq: set hostPath for rabbitmq-data In an Edge environment without a distributed storage environment, it should be able to store rabbitmq data in the local path as well. This patch added an option to use it in a more diverse environment. Change-Id: Ia3c0dfaa58c237e424197f1406bd66fb991bea18 Story: 2005753 Task: 33455 --- rabbitmq/templates/statefulset.yaml | 6 ++++++ rabbitmq/values.yaml | 3 +++ 2 files changed, 9 insertions(+) diff --git a/rabbitmq/templates/statefulset.yaml b/rabbitmq/templates/statefulset.yaml index bf48280d8..89a121dda 100644 --- a/rabbitmq/templates/statefulset.yaml +++ b/rabbitmq/templates/statefulset.yaml @@ -247,8 +247,14 @@ spec: defaultMode: 0444 {{- if not $envAll.Values.volume.enabled }} - name: rabbitmq-data + {{- if .Values.volume.use_local_path.enabled }} + hostPath: + path: {{ .Values.volume.use_local_path.host_path }} + type: DirectoryOrCreate + {{- else }} emptyDir: {} {{- end }} + {{- end }} {{- if $envAll.Values.volume.enabled }} volumeClaimTemplates: - metadata: diff --git a/rabbitmq/values.yaml b/rabbitmq/values.yaml index f2868c7c7..eaa960951 100644 --- a/rabbitmq/values.yaml +++ b/rabbitmq/values.yaml @@ -319,6 +319,9 @@ network_policy: - {} volume: + use_local_path: + enabled: false + host_path: /var/lib/rabbitmq chown_on_start: true enabled: true class_name: general