This file contains hidden or 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/zsh | |
autoload colors | |
if [[ "$terminfo[colors]" -gt 8 ]]; then | |
colors | |
fi | |
for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do | |
eval ${COLOR}='$fg_no_bold[${(L)COLOR}]' |
This file contains hidden or 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
#cloud-config | |
write-files: | |
- path: /opt/bin/wupiao | |
permissions: '0755' | |
content: | | |
#!/bin/bash | |
# [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen | |
[ -n "$1" ] && [ -n "$2" ] && while ! curl --output /dev/null \ | |
--silent --head --fail \ | |
http://${1}:${2}; do sleep 1 && echo -n .; done; |
This file contains hidden or 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 | |
FROM=$1 | |
[[ -n "$FROM" ]] || exit 1 | |
for ITEM in ns secrets configmaps rc deployments svc; do | |
for OBJ in $(kubectl --context=$FROM get $ITEM -o name); do | |
kubectl --context=$FROM get $OBJ -o yaml | kubectl create -f - | |
done |
This file contains hidden or 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 | |
# Usage: devnuller <deployment> | |
# When troubleshooting k8s deployments, it is sometimes helpful to set command: ["tail", "-f", "/dev/null"] | |
# so that you have a long-running null-command, allowing you to `kubectl exec ...` in and troubleshoot the | |
# environment. This will do that, and tell you how to roll back your command. | |
DEPLOYMENT=" | |
P_REV=$(kubectl get deployment/${DEPLOYMENT} -o json | \ | |
jq -r '.metadata.annotations["deployment.kubernetes.io/revision"]') |
OlderNewer