From 8b06c087d5fde6e7ade86f48f455e637cad7bc11 Mon Sep 17 00:00:00 2001 From: Nikhil K Date: Wed, 7 Feb 2024 22:11:48 +0530 Subject: [PATCH] update --- yaml/kafka/values.yaml | 2 ++ yaml/pre-install-hook.yaml | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 yaml/kafka/values.yaml create mode 100644 yaml/pre-install-hook.yaml diff --git a/yaml/kafka/values.yaml b/yaml/kafka/values.yaml new file mode 100644 index 0000000..894eb21 --- /dev/null +++ b/yaml/kafka/values.yaml @@ -0,0 +1,2 @@ +nodeSelector: + label: external \ No newline at end of file diff --git a/yaml/pre-install-hook.yaml b/yaml/pre-install-hook.yaml new file mode 100644 index 0000000..4b91ce5 --- /dev/null +++ b/yaml/pre-install-hook.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Pod +metadata: + name: preinstall-hook + annotations: + "helm.sh/hook": "pre-install" +spec: + containers: + - name: pre-install-container + image: bitnami/kubectl:latest + # image: busybox + imagePullPolicy: IfNotPresent + command: ["/bin/sh", "-c"] + args: + - num_jobs=$(kubectl get jobs --field-selector status.successful=0 --output json | jq -j '.items | length') + - echo "number running jobs - $num_jobs" + - while [[ "$num_jobs" > 0 ]];do;echo "waiting for running jobs to complete";sleep 20;num_jobs=$(kubectl get jobs --field-selector status.successful=0 --output json | jq -j '.items | length');echo "number running jobs - $num_jobs";done + restartPolicy: Never + terminationGracePeriodSeconds: 0