init commit

This commit is contained in:
2022-03-13 13:29:53 +01:00
commit ef753a3c7e
8 changed files with 679 additions and 0 deletions

35
provision/k9s.sh Normal file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set -euo pipefail
#
# Helper functions
#
declare -i term_width=80
h1() {
declare border padding text
border='\e[1;34m'"$(printf '=%.0s' $(seq 1 "$term_width"))"'\e[0m'
padding="$(printf ' %.0s' $(seq 1 $(((term_width - $(wc -m <<<"$*")) / 2))))"
text="\\e[1m$*\\e[0m"
echo -e "$border"
echo -e "${padding}${text}${padding}"
echo -e "$border"
}
h2() {
printf '\e[1;33m==>\e[37;1m %s\e[0m\n' "$*"
}
k9s_version="${1:-v0.24.15}"; shift || true
h1 "Install k9s"
h2 "Version: ${k9s_version}"
# download and install.
wget -qO- "https://github.com/derailed/k9s/releases/download/$k9s_version/k9s_Linux_x86_64.tar.gz" \
| tar xzf - k9s
install -m 755 k9s /usr/local/bin/
rm k9s
# try it.
k9s version