Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add kubeblocks component postStart hook demo #2115

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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