Skip to content

Instantly share code, notes, and snippets.

@ams0
Last active September 18, 2024 09:29
Show Gist options
  • Save ams0/13b7cf0c7daf5f781cffa0b4e39cdc41 to your computer and use it in GitHub Desktop.
Save ams0/13b7cf0c7daf5f781cffa0b4e39cdc41 to your computer and use it in GitHub Desktop.
#!/bin/bash
curl https://raw.githubusercontent.com/ahmetb/kubectl-alias/master/.kubectl_aliases -o ~/.kubectl_aliases ; source ~/.kubectl_aliases
echo "source ~/.kubectl_aliases" >> ~/.bashrc
(
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
)
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
echo 'export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"' >> ~/.bashrc
kubectl krew install ctx node-admin
grep -qxF '[core]' ~/.azure/config || echo -e '[core]\noutput = table' >> ~/.azure/config
az account set --subscription sub-dev-eu-kubehub
export CLUSTER_RG=rg-test-alessandro ; export CLUSTER_NAME=infra
az aks get-credentials --resource-group $CLUSTER_RG -n $CLUSTER_NAME --overwrite-existing -a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment