Created
January 18, 2019 06:39
-
-
Save ipedrazas/c30b747f281d9ea59acf86dbbe37294a to your computer and use it in GitHub Desktop.
Pre stop hook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
env: | |
- name: POD_NAME | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.name | |
- name: POD_NAMESPACE | |
valueFrom: | |
fieldRef: | |
fieldPath: metadata.namespace | |
lifecycle: | |
preStop: | |
exec: | |
command: | |
- "/bin/bash" | |
- "-c" | |
- "curl -X DELETE -H "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt https://$KUBERNETES_SERVICE_HOST/api/v1/namespaces/$POD_NAMESPACE/pods/$POD_NAME?gracePeriodSeconds=1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment