Kubernetes

[Kubernetes] k3s kubernetes dashboard 설정

IT-PAPA 2023. 5. 2. 06:52
728x90
반응형

1. kubernetes dashboard 현재 최신버전 설치

GITHUB_URL=https://github.com/kubernetes/dashboard/releases
VERSION_KUBE_DASHBOARD=$(curl -w '%{url_effective}' -I -L -s -S ${GITHUB_URL}/latest -o /dev/null | sed -e 's|.*/||')
sudo k3s kubectl create -f https://raw.githubusercontent.com/kubernetes/dashboard/${VERSION_KUBE_DASHBOARD}/aio/deploy/recommended.yaml

 

2. admin-user 생성

vi admin-user.yaml
kubectl apply -f admin-user.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: admin-user
  namespace: kubernetes-dashboard

 

3. admin-user-role 생성

vi admin-user-role.yaml
kubectl apply -f admin-user-role.yaml
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

 

4. kubernetes 접속할 token 발행

sudo k3s kubectl -n kubernetes-dashboard create token admin-user

 

5. kubernetes dashboard 실행

sudo k3s kubectl proxy --port=9090 --address=0.0.0.0 --accept-hosts='^*$'

5. kubernetes dashboard 실행
5. kubernetes dashboard 실행

 

6. kubernetes dashboard 접속 화면

http://[서버 IP]:9090/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/

kubernetes dashboard 접속 화면
kubernetes dashboard 접속 화면

728x90
반응형
LIST