diff --git a/tools/kubeblocks_helm/pika/templates/clusterdefinition.yaml b/tools/kubeblocks_helm/pika/templates/clusterdefinition.yaml index a81a82bdbb..4433e81510 100644 --- a/tools/kubeblocks_helm/pika/templates/clusterdefinition.yaml +++ b/tools/kubeblocks_helm/pika/templates/clusterdefinition.yaml @@ -32,6 +32,13 @@ spec: namespace: {{ .Release.Namespace }} volumeName: script defaultMode: 0555 + postStartSpec: + cmdExecutorConfig: + image: {{ .Values.image.pika.registry | default "docker.io" }}/{{ .Values.image.pika.repository }}:{{ .Values.image.pika.tag }} + command: + - /script/pika-group-post-start.sh + scriptSpecSelectors: + - name: pika-script podSpec: containers: - name: pika diff --git a/tools/kubeblocks_helm/pika/templates/script.yaml b/tools/kubeblocks_helm/pika/templates/script.yaml index d550ace041..aeb893a54b 100644 --- a/tools/kubeblocks_helm/pika/templates/script.yaml +++ b/tools/kubeblocks_helm/pika/templates/script.yaml @@ -7,3 +7,13 @@ metadata: data: admin.sh: |- {{- .Files.Get "script/admin.sh" | nindent 4 }} + pika-group-post-start.sh: |- + #! /bin/bash + set -x + + echo "add your post start script logic here" + envParams=$(env) + echo "add envs can be used in script:" + echo $envParams + + sleep 60 \ No newline at end of file