Last active
July 13, 2021 05:45
-
-
Save pratikbin/82ca2a0d82aaf73434987e3ace35b1ab to your computer and use it in GitHub Desktop.
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
## Delete namespace from terminating state | |
kubectl get namespace "stucked-namespace" -o json \ | |
| tr -d "\n" | sed "s/\"finalizers\": \[[^]]\+\]/\"finalizers\": []/" \ | |
| kubectl replace --raw /api/v1/namespaces/stucked-namespace/finalize -f - | |
## Delete cascade in sts | |
kc delete sts --cascade=false | |
## Secret decode | |
kc -n <namespace-name> get secret <secret-name> -o go-template=' | |
{{range $k,$v := .data}}{{printf "%s: " $k}}{{if not $v}}{{$v}}{{else}}{{$v | base64decode}}{{end}}{{"\n"}}{{end}}' | |
## copy secret to different namespace | |
kc get secret <secret-name> --namespace=<namespace-name-where-secret-resides> -o yaml | grep -v '^\s*namespace:\s' | kc apply --namespace=<namespace-name-in-which-to-create-secret> -f - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please add this command which will create or copy secret from one namespace to another,