From 390cb1026398a024a4dfd0edba7a80b5ae45efce Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Sat, 9 Mar 2024 23:54:02 +0800 Subject: [PATCH] fix: support saving pika config to hostpath (#2476) Co-authored-by: liuchengyu --- .../pika/templates/clusterdefinition.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/kubeblocks_helm/pika/templates/clusterdefinition.yaml b/tools/kubeblocks_helm/pika/templates/clusterdefinition.yaml index 80358eaf0a..ea0bc82983 100644 --- a/tools/kubeblocks_helm/pika/templates/clusterdefinition.yaml +++ b/tools/kubeblocks_helm/pika/templates/clusterdefinition.yaml @@ -46,6 +46,20 @@ spec: scriptSpecSelectors: - name: pika-script podSpec: + initContainers: + - name: init-config + image: busybox:1.28 + imagePullPolicy: IfNotPresent + command: + - /bin/sh + - -ec + - | + if [ ! -f "/data/pika.conf" ];then cp /etc/pika/pika.conf /data/pika.conf; fi + volumeMounts: + - name: config + mountPath: /etc/pika + - name: data + mountPath: /data containers: - name: pika ports: @@ -60,7 +74,7 @@ spec: - "/pika/bin/pika" args: - "-c" - - "/etc/pika/pika.conf" + - "/data/pika.conf" - name: codis-admin volumeMounts: - name: script