-
Notifications
You must be signed in to change notification settings - Fork 5
/
.kubefunctions
34 lines (28 loc) · 1.22 KB
/
.kubefunctions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
function kctx() {
kubectl-ctx "$1"
}
function kns() {
kubectl-ns "$1"
}
function k8sdashboard() {
local kdashuser=${1:-rony}
kubectl --namespace kubernetes-dashboard create token "$kdashuser" | pbcopy | echo "=> K8s dashboard token copied to pasteboard for user $kdashuser."
echo "=> http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/"
kubectl proxy
}
function k8sgui() {
local context=${1:-k3d-devship}
local http_port=${2:-9999}
echo -e "==> Go to http://localhost:${http_port} \n\n"
kube-explorer --https-listen-port=0 --http-listen-port="$http_port" --debug --context="$context"
}
function saildevship() {
# Kubernetes Devship Repo https://github.com/nurrony/devship
$DEV_ZONE/projects/open-sources/devship/devship
}
# aliases
alias k8s="kubectl"
alias nukedevship='k3d cluster stop devship && k3d cluster delete devship && echo "\ndevship k8s cluster has been nuked"'
alias minikube-start='minikube start --cpus 2 --disk-size "50g" --memory 4096 --extra-config=apiserver.authorization-mode=RBAC --extra-config=apiserver.runtime-config=settings.k8s.io/v1alpha1=true'
alias minikube-reg='minikube start --insecure-registry localhost:5000'