Created
October 28, 2018 11:33
-
-
Save superseb/e9f2a0b13cce55946201ade5ae24a500 to your computer and use it in GitHub Desktop.
Remove CATTLE_CA_CHECKSUM from cattle-node-agent DaemonSet
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
#!/bin/bash | |
# Check current CATTLE_CA_CHECKSUM value | |
kubectl -n cattle-system get ds -o go-template='{{range .items}}{{range .spec.template.spec.containers}}{{range .env}}{{if eq .name "CATTLE_CA_CHECKSUM"}}{{.name}}{{"="}}{{.value}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}' | |
# Remove CATTLE_CA_CHECKSUM value | |
kubectl -n cattle-system patch daemonset/cattle-node-agent -p '{"spec": {"template": {"spec": {"containers": [{"name": "agent", "env": [{"name": "CATTLE_CA_CHECKSUM", "value": ""}]}]}}}}' | |
# Check changed CATTLE_CA_CHECKSUM value | |
kubectl -n cattle-system get ds -o go-template='{{range .items}}{{range .spec.template.spec.containers}}{{range .env}}{{if eq .name "CATTLE_CA_CHECKSUM"}}{{.name}}{{"="}}{{.value}}{{"\n"}}{{end}}{{end}}{{end}}{{end}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment