Is it possible to make Helm charts deployment to fail if test which is run before installation fails? Because now despite the test fails, status is 'Deployed'.
My test, which checks if MongoDB is deployed and is reachable:
apiVersion: v1
kind: Pod
metadata:
name: "-database-connection-test"
annotations:
"helm.sh/hook": pre-install,test-success
"helm.sh/hook-delete-policy": before-hook-creation
spec:
containers:
- name: -database-connection-test
image:
imagePullPolicy: Always
env:
- name: HOST
value:
- name: PORT
value:
- name: DATABASE_NAME
value:
- name: USERNAME
value:
- name: PASSWORD
value:
command: ["sh", "-c", "mongo --username $USERNAME --password $PASSWORD --authenticationDatabase $DATABASE_NAME --host $HOST --port $PORT"]
restartPolicy: Never
Aucun commentaire:
Enregistrer un commentaire