commands

# cluster作成
kind create cluster --name k8s-playground --config kind-config.yaml

# cluster削除
kind delete cluster --name k8s-playground

動作確認

# ingress
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml

# Podやらなんやらをつくる
kubectl apply -f target.yaml
COPY
# should output "foo"
curl localhost/foo
# should output "bar"
curl localhost/bar

dashboardを開く

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.5.0/aio/deploy/recommended.yaml

kubectl proxy

# SAとClusterRoleBindingを作成
kubectl apply -f dashboard/

# tokenを取得
kubectl -n kubernetes-dashboard get secret $(kubectl -n kubernetes-dashboard get sa/admin-user -o jsonpath="{.secrets[0].name}") -o go-template="{{.data.token | base64decode}}"
# SAとClusterRoleBindingを削除
kubectl delete -f dashboard/

このリンクにアクセスしてtokenを入力するとログインできる

dashboard

links