Last active
May 31, 2019 22:59
-
-
Save vsliouniaev/20a917e329b749ae8b29d3056ab6243b to your computer and use it in GitHub Desktop.
This file contains 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
# GPG - this allows signing of git commits | |
export GPG_TTY=$(tty) | |
#GO | |
export GOROOT=/usr/local/go | |
export GOPATH=/c/dev/go | |
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH | |
# git commands | |
gl() { git log --pretty --oneline "$@"; } | |
gs() { git status -s; } | |
# Kubernetes | |
export HELM_HOME=/mnt/c/dev/helm | |
export DOCKER_HOST=tcp://0.0.0.0:2375 | |
k() { kubectl "$@"; } | |
kg() { kubectl get "$@"; } | |
kd() { kubectl describe "$@"; } | |
ka() { kubectl apply "$@"; } | |
kc() { kubectl config current-context; } | |
kns() { kubectl config set-context $(kubectl config current-context) --namespace="$@"; } | |
kcontext() { if [ $# -eq 0 ]; then kubectl config current-context; echo "---"; kubectl config view | yq -r .contexts[].name; else kubectl config use-context $1; fi; } | |
prom-oplog() { kubectl logs $(kubectl get po --no-headers --namespace=monitoring -l operator=prometheus | awk '{print $1}') -f --namespace=monitoring --tail=20; } | |
helm-init-rbac() { | |
helm init; | |
kubectl create serviceaccount --namespace kube-system tiller; | |
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller; | |
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'; | |
helm init --service-account tiller --upgrade; | |
} | |
new-kind() { kind delete cluster && kind create cluster && kcontext kubernetes-admin@kind && helm-init-rbac; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment