From 8affec3fbbdd1bcde9579a9829900ada0369ad40 Mon Sep 17 00:00:00 2001 From: liuchengyu Date: Fri, 8 Mar 2024 19:30:37 +0800 Subject: [PATCH] fix: support saving pika config to hostpath --- .../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 537b80453f..84a84cbe32 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