Last active
July 30, 2021 10:18
-
-
Save toksdotdev/01147e812d9b2298f5e5b95bd8769918 to your computer and use it in GitHub Desktop.
Useful Kubernetes utils
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
# Scale deployments | |
DEPLOYMENT=traefik | |
NAMESPACE=kube-system | |
kubectl scale deploy $DEPLOYMENT --replicas=0 -n $NAMESPACE | |
# Fetch k8s secret for any namespace (you must be authorized to fetch the secet) | |
SERVICE_NAME=whoami | |
NAMESPACE=kube-system | |
kubectl get secret $SERVICE_NAME-secrets -n $NAMESPACE -o go-template='{{range $k,$v := .data}}{{printf "%s: " $k}}{{if not $v}}{{$v}}{{else}}{{$v | base64decode}}{{end}}{{"\n"}}{{end}}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment