Skip to content

Commit

Permalink
add kubeblock component post start demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Y-Rookie committed Nov 9, 2023
1 parent 8a9704c commit 45b73ea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tools/kubeblocks_helm/pika/templates/clusterdefinition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions tools/kubeblocks_helm/pika/templates/script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 45b73ea

Please sign in to comment.