helm create kcdlahore-2024
helm install kcdlahore-2024-release-1 ./kcdlahore-2024
helm upgrade kcdlahore-2024-release-1 ./kcdlahore-2024
helm uninstall kcdlahore-2024-release-1
Create a new directory inside templates
called hooks
and create a new file called pre-install-hook.yaml
with the following content:
apiVersion: batch/v1
kind: Job
metadata:
name: pre-install-hook
namespace: {{ .Values.namespace }}
spec:
template:
spec:
containers:
- name: pre-install-hook
image: alpine:latest
command: ["echo", "Executing pre-installation hook"]
restartPolicy: Never
backoffLimit: 1
kubectl get jobs -n dev
kubectl get pods -n dev
kubectl logs <job-pod-name> -n dev