Created
February 7, 2018 16:38
-
-
Save mwinters0/739b03750861fb368af5d2e5c96b21cd to your computer and use it in GitHub Desktop.
Patch / update a configmap from inside Kubernetes using curl
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
KUBE_TOKEN=$(</var/run/secrets/kubernetes.io/serviceaccount/token) | |
NAMESPACE=myapp-dev | |
CONFIGMAP_NAME=testconfig | |
curl -sSk \ | |
-X PATCH \ | |
-d @- \ | |
-H "Authorization: Bearer $KUBE_TOKEN" \ | |
-H 'Accept: application/json' \ | |
-H'Content-Type: application/strategic-merge-patch+json' \ | |
https://$KUBERNETES_SERVICE_HOST:$KUBERNETES_PORT_443_TCP_PORT/api/v1/namespaces/$NAMESPACE/configmaps/$CONFIGMAP_NAME <<'EOF' | |
{ | |
"kind": "ConfigMap", | |
"apiVersion": "v1", | |
"data": { | |
"foo": "bar" | |
} | |
} | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment