๐Ÿ‘€ ์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ๋ชจ๋‹ˆํ„ฐ๋ง[๋Œ€์‹œ๋ณด๋“œ]

๊น€์„ฑ์ธยท2023๋…„ 10์›” 20์ผ
0

[DevOps] ๐ŸณDocker & Kubernetes

๋ชฉ๋ก ๋ณด๊ธฐ
47/62

https://kubernetes.io/ko/docs/tasks/access-application-cluster/web-ui-dashboard/

๋ฐฐํฌ

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

์ฟ ๋ฒ„๋„คํ‹ฐ์Šค ๋Œ€์‹œ๋ณด๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๋ฉด Metrics-Server๊ฐ€ ํ•„์š”ํ•จ

kubernetes-dashboard ๋„ค์ž„ ์ŠคํŽ˜์ด์Šค

ํด๋Ÿฌ์Šคํ„ฐ IP๋ฅผ ํ†ตํ•ด ๋ฐฐํฌ๋œ ๋ชจ์Šต

์„œ๋น„์Šคํƒ€์ž… LoadBalancer๋กœ ๋ณ€๊ฒฝ

kubectl patch svc kubernetes-dashboard -n kubernetes-dashboard -p '{"spec": {"type": "LoadBalancer"}}'

gcp ๋ฐฉํ™”๋ฒฝ ํ—ˆ์šฉ

gcloud compute firewall-rules create kubernetes-dashboard --allow=tcp:<ํฌํŠธ๋ฒˆํ˜ธ>

๋Œ€์‹œ๋ณด๋“œ UI ์ ‘๊ทผ

https://EXTERNAL-IP ๋ฅผํ†ตํ•ด ์ ‘์†
๋นˆ๊ณต๊ฐ„ ๋ˆ„๋ฅด๊ณ  thisisunsafe ๋ผ๊ณ  ์ž…๋ ฅ

์ƒ˜ํ”Œ ์‚ฌ์šฉ์ž ๋งŒ๋“ค๊ธฐ

https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md

์œ ์ € ์ƒ์„ฑ

cat <<EOF | kubectl apply -f - ๋ž‘ ๊ฐ™์ด ์จ๋„๋จ

apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: admin-user
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
- kind: ServiceAccount
  name: admin-user
  namespace: kubernetes-dashboard

ํ† ํฐ ์ƒ์„ฑ

kubectl -n kubernetes-dashboard create token admin-user

ํ•ด๋‹นํ† ํฐ์„ kubernetes dashboard ํ† ํฐ์— ์ž…๋ ฅํ•˜๊ธฐ

์ ‘์†์™„๋ฃŒ

profile
๊ฐœ๋ฐœ์ž๊ฐ€ ๊ฟˆ์ธ 25์‚ด ๋Œ€ํ•™์ƒ์ž…๋‹ˆ๋‹ค.

0๊ฐœ์˜ ๋Œ“๊ธ€