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
fdisk /dev/sdb | |
mkdir /var/lib/docker | |
echo $(blkid /dev/sdb1 | awk '{print $2}' | sed -e 's/"//g') /var/lib/docker ext4 defaults 0 0 >> /etc/fstab | |
sed -i 's/\/dev\/mapper\/centos-swap/#\/dev\/mapper\/centos-swap/g' /etc/fstab | |
mount -a | |
reboot |
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
kubectl get configmap -n kube-system cattle-controllers -o json | jq -r '.metadata.annotations["control-plane.alpha.kubernetes.io/leader"]' | jq -r ".holderIdentity" |
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
etcdctl get / --prefix --endpoints=${ETCDCTL_ENDPOINTS} --keys-only | grep ${NAMESPACE} |
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
for i in $(kubectl get state -n hobbyfarm | awk '{print $1}' | grep -v "NAME"); do kubectl -n hobbyfarm patch state $i -p '{"metadata":{"finalizers": []}}' --type=merge; 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/sh | |
sed -i "/\b\UUID\b/d" /etc/sysconfig/network-scripts/ifcfg-ens192 | |
rm -vf /etc/ssh/ssh_host_* | |
systemctl stop systemd-journald.socket | |
find /var/log -type f -exec rm {} \; | |
rm -rf /var/log/journal/* | |
rm /root/.bash_history; history -c | |
systemctl poweroff |
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 | |
REPO=${REPO:-rancher} | |
IMAGE=${IMAGE:-rancher-agent} | |
TAG=${TAG:-v2.5.1-rc1} | |
DESTREPO=${DESTREPO:-oats87} | |
DESTIMAGE=${DESTIMAGE:-$IMAGE} | |
DESTTAG=${DESTTAG:-$TAG} |
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
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml; export PATH=$PATH:/var/lib/rancher/rke2/bin |
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
crictl -r /var/run/k3s/containerd/containerd.sock exec -it $(crictl -r /var/run/k3s/containerd/containerd.sock ps | grep etcd | awk '{print $1}') /bin/bash |
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/sh | |
for pod in $(kubectl get pods --no-headers -l app=rancher -n cattle-system | cut -d ' ' -f1); do | |
echo Collecting pprof information for $pod - this will take some time. | |
kubectl -n cattle-system exec $pod -c rancher -- curl -s http://localhost:6060/debug/pprof/profile -o profile; | |
kubectl -n cattle-system cp $pod:profile pprof-$pod-profile -c rancher; | |
kubectl -n cattle-system exec $pod -c rancher -- curl -s http://localhost:6060/debug/pprof/goroutine -o goroutine; | |
kubectl -n cattle-system cp $pod:goroutine pprof-$pod-goroutine -c rancher; | |
kubectl -n cattle-system exec $pod -c rancher -- curl -s http://localhost:6060/debug/pprof/heap -o heap; | |
kubectl -n cattle-system cp $pod:heap pprof-$pod-heap -c rancher; | |
kubectl -n cattle-system exec $pod -c rancher -- curl -s http://localhost:6060/debug/pprof/threadcreate -o threadcreate; |
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
CLUSTER_NAME="CLUSTER-NAME"; kubectl get rkebootstrap -n fleet-default $(kubectl get secrets -n fleet-default --field-selector=type=rke.cattle.io/machine-plan -l cluster.x-k8s.io/cluster-name="$CLUSTER_NAME",rke.cattle.io/init-node=true -o json | jq -r '.items[0].metadata.ownerReferences[0].name') -o json | jq -r '.metadata.ownerReferences[0].name' |