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
| docker exec etcd etcdctl get /registry --prefix=true --keys-only | grep -v ^$ | awk -F'/' '{ if ($3 ~ /cattle.io/) {h[$3"/"$4]++} else { h[$3]++ }} END { for(k in h) print h[k], k }' | sort -n > etcd-count-objecttype.txt |
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 | |
| find /proc/*/fd -lname anon_inode:inotify | | |
| cut -d/ -f3 | | |
| xargs -I '{}' -- ps --no-headers -o '%p %U %c' -p '{}' | | |
| uniq -c | | |
| sort -nr | |
| ## check for max_user_watches and/or max_user_instances |
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 | |
| POD=$(kubectl get pods --no-headers -n cattle-system -l app=rancher26x -o custom-columns=":metadata.name") | |
| PVC=$(kubectl exec -n cattle-system $POD -- find /opt/local-path-provisioner/ -maxdepth 1 -type d -not -path /opt/local-path-provisioner/) | |
| printf "Found pod: %s\n" $POD | |
| printf "Found pvc: %s\n" $PVC | |
| kubectl cp cattle-system/$POD:/opt/local-path-provisioner ./temp-backups/ | |
| ls ./temp-backups/pvc-* |
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
| # install system upgrade controller | |
| kubectl apply -f https://raw.githubusercontent.com/rancher/system-upgrade-controller/master/manifests/system-upgrade-controller.yaml | |
| # First, label the target node | |
| kubectl label node/k3d-zues-server-0 k3s-upgrade=true | |
| # Then create the plan object in the cluster | |
| kubectl apply -f upgrade_plan.yml | |
| ... |
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
| Just some bits of wisdom ... whenever you use a SUSE os, tumbleweed, SLES, MicroOs, SLE Micro, LEAP, | |
| first thing to do ... | |
| # systemctl disable --now NetworkManager | |
| # zypper in wicked -y | |
| # systemctl enable --now wicked | |
| Replace NetworkManager with wicked & use normal /etc/sysconfig/network/ifcfg-* config files. | |
| NM seems to be a desktop-first tool, IMHO, and wicked is very easy and simple to set up. |
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
| sed -i '/^GRUB_CMDLINE_LINUX/ s/"$/ systemd.unified_cgroup_hierarchy=0"/' /etc/default/grub | |
| transactional-update grub2-mkconfig -o /boot/grub2/grub.cfg | |
| ... |
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
| --- | |
| - hosts: bionic | |
| become: true | |
| vars_files: ~/YAML/vars/become.yml | |
| vars: | |
| today: "{{ lookup('pipe', 'date +%Y_%m%d') }}" | |
| cluster_home: "{{ lookup('pipe', 'pwd') }}" | |
| tasks: | |
| - name: find tmp/ logfiles |
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 | |
| [[ -d ./fio-test ]] || mkdir fio-test | |
| fio --rw=write --ioengine=sync --size=200m --bs=2300 --directory=./fio-test --name=io-test | |
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
| awk '{$1="";print $0 }' somepath/k8s/podlogs/k8s_rancher-audit-log_rancher-7fdc4d94b4-j4tf2_cattle-system_6f9f3596-8473-46c4-8d63-5b462f693fa4_0 | jql | |
| ## lop off first field, send rest to jql func/alias | |
| ## seen here -- https://gist.github.com/flrichar/7f6ebacfb4405988913e327d6ec5adc5 | |
| ## ignoring non-json may be better -- https://gist.github.com/flrichar/163c7c2d296e8dfc7a14191ecd790803 | |
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 | |
| if $(tmux has-session); then | |
| echo "Tmux has-sessions, exiting..."; exit | |
| else | |
| echo "Tmux no sessions, creating..." | |
| fi | |
| SCREENWIN=$(printf 'C-a c %0.s' {1..5}) | |
| TSESSION="tmux" |