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