Skip to content

Instantly share code, notes, and snippets.

@hsyed
Created September 27, 2017 18:18
Show Gist options
  • Save hsyed/5156711bf28229882b82b45ecd184231 to your computer and use it in GitHub Desktop.
Save hsyed/5156711bf28229882b82b45ecd184231 to your computer and use it in GitHub Desktop.
# Sup file for https://github.com/pressly/sup
#
version: 0.5
networks:
workers:
inventory: kubectl get nodes -o json | jq -r '.items[] | select(.metadata.labels["axsy.com/role"] =="worker") | .status.addresses[] | select (.type == "InternalIP") | .address | "core@" + . '
controllers:
inventory: kubectl get nodes -o json | jq -r '.items[] | select(.metadata.labels["kubernetes.io/role"] =="master") | .status.addresses[] | select (.type == "InternalIP") | .address | "core@" + . '
all:
inventory: kubectl get nodes -o json | jq -r '.items[].status.addresses[] | select (.type == "InternalIP") | .address | "core@" + . '
commands:
bash:
desc: Interactive Bash on all hosts
stdin: true
run: bash
uname:
desc: Uname on all hosts
run: uname -a
df-root:
desc: get the df stats of the root volume
run: df -h / | awk '{if ($1 != "Filesystem") print "\t/ " 100-$5 "% of " $2 " free." }'
jc-du:
desc: journalctl disk usage
run: journalctl --disk-usage
jc-vacuum-256m:
desc: journalctl reduce to 256m
run: sudo journalctl --vacuum-size=256M
coreos-version:
desc: get the coreos version
run: cat /etc/os-release | awk -F "=" '/VERSION_ID/ {print $2}'
restart-kubelet:
desc: restart the kubelet
run: sudo systemctl restart kubelet
kill-controller-managers:
desc: kill the kube controller-managers
run: docker kill $(docker ps --no-trunc --filter 'name=^.*kube-controller-manager.*' -q)
kill-api-server:
desc: kill the kube apiservers
run: docker kill $(docker ps --no-trunc --filter 'name=^.*kube-apiserver.*' -q)
kill-scheduler:
desc: kill the kube schedulers
run: docker kill $(docker ps --no-trunc --filter 'name=^.*kube-scheduler.*' -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment