본문 바로가기
kubenetes

minikube dashboard 활성화, 접속 방법

by kyeongseo.oh 2022. 3. 13.

minikube의 대시보드를 활성화 시켜봄

 

일단 첫번째로 addons를 확인해봐야함

 

minikube addons list로 addons가 활성화 상태인 지 비활성화 상태인 지 확인할 수 있음

[ddadmin@edge .kube]$ minikube addons list
|-----------------------------|----------|--------------|--------------------------------|
|         ADDON NAME          | PROFILE  |    STATUS    |           MAINTAINER           |
|-----------------------------|----------|--------------|--------------------------------|
| ambassador                  | minikube | disabled     | third-party (ambassador)       |
| auto-pause                  | minikube | disabled     | google                         |
| csi-hostpath-driver         | minikube | disabled     | kubernetes                     |
| dashboard                   | minikube | enabled ✅   | kubernetes                     |
| default-storageclass        | minikube | enabled ✅   | kubernetes                     |
| efk                         | minikube | disabled     | third-party (elastic)          |
| freshpod                    | minikube | disabled     | google                         |
| gcp-auth                    | minikube | disabled     | google                         |
| gvisor                      | minikube | disabled     | google                         |
| helm-tiller                 | minikube | disabled     | third-party (helm)             |
| ingress                     | minikube | disabled     | unknown (third-party)          |
| ingress-dns                 | minikube | disabled     | google                         |
| istio                       | minikube | disabled     | third-party (istio)            |
| istio-provisioner           | minikube | disabled     | third-party (istio)            |
| kong                        | minikube | disabled     | third-party (Kong HQ)          |
| kubevirt                    | minikube | disabled     | third-party (kubevirt)         |
| logviewer                   | minikube | disabled     | unknown (third-party)          |
| metallb                     | minikube | disabled     | third-party (metallb)          |
| metrics-server              | minikube | disabled     | kubernetes                     |
| nvidia-driver-installer     | minikube | disabled     | google                         |
| nvidia-gpu-device-plugin    | minikube | disabled     | third-party (nvidia)           |
| olm                         | minikube | disabled     | third-party (operator          |
|                             |          |              | framework)                     |
| pod-security-policy         | minikube | disabled     | unknown (third-party)          |
| portainer                   | minikube | disabled     | portainer.io                   |
| registry                    | minikube | disabled     | google                         |
| registry-aliases            | minikube | disabled     | unknown (third-party)          |
| registry-creds              | minikube | disabled     | third-party (upmc enterprises) |
| storage-provisioner         | minikube | enabled ✅   | google                         |
| storage-provisioner-gluster | minikube | disabled     | unknown (third-party)          |
| volumesnapshots             | minikube | disabled     | kubernetes                     |
|-----------------------------|----------|--------------|--------------------------------|

 

만약 dashboard가 비활성화 상태라면 다음 커맨드로 활성화 시켜줘야함.

minikube addons enable dashboard

 

그 다음 minikube dashboard 명령을 입력하면 대시보드가 활성화된다.

그런데 url이 hostname이나 본인 ip가 아닌 localhost임

minikube를 서버에 올려서 아래 url의127.0.0.1와 내 윈도우 pc에서 입력한 127.0.0.1은 다름. 즉 접속불가

external ip로 접속 가능하게 세팅이 필요함.

[ddadmin@edge .kube]$ minikube dashboard
* Verifying dashboard health ...
* Launching proxy ...
* Verifying proxy health ...
* Opening http://127.0.0.1:41708/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...

 

proxy 설정을 해줌. 아래 error는 이미 한번 돌려서 에러난거임

foreground라서 커맨드를 입력하면 다른 작업을 못함

nohup으로 background에서 돌게 해줬음

맨 밑에 0.0.0.0:8001:은 잘 기억해둬야함. dashboard 접속할 때 8001로 들어가야됌 (default값임)

[ddadmin@edge .kube]$ kubectl proxy --address='0.0.0.0' --disable-filter=true &
W0313 04:44:38.770361   96272 proxy.go:175] Request filter disabled, your proxy is vulnerable to XSRF attacks, please be cautious
error: listen tcp 0.0.0.0:8001: bind: address already in use

 

다시 dashboard를 실행해봄

dashboard도 마찬가지로 foreground process라서 nohup으로 돌림

[ddadmin@edge .kube]$ * Verifying dashboard health ...
* Launching proxy ...
* Verifying proxy health ...
* Opening http://127.0.0.1:36004/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...
  http://127.0.0.1:36004/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/

 

url에서 ip:port만 서버ip:8001로 바꾼 후 chrome에서 접속해봄

dashboard도 잘 올라왔고 노드들의 정보도 잘 가져오고 있음

 

 


참고

 

kubectl proxy stop하는 방법

[ddadmin@edge root]$ ps -ef | grep "kubectl proxy"
ddadmin    70568       1  0 04:04 ?        00:00:01 kubectl proxy --address=0.0.0.0 --disable-filter=true
ddadmin   112333  109434  0 05:09 pts/1    00:00:00 grep --color=auto kubectl proxy
[ddadmin@edge root]$ kill -9 70568

 

minikube dashboard는 kubernetes-dashboard라는 namespace에 올라가 있음

[ddadmin@edge root]$ kubectl get pods --namespace=kubernetes-dashboard
NAME                                        READY   STATUS    RESTARTS      AGE
dashboard-metrics-scraper-58549894f-jltpx   1/1     Running   0             77m
kubernetes-dashboard-ccd587f44-gc6x8        1/1     Running   5 (18s ago)   77m

 

'kubenetes' 카테고리의 다른 글

kubernetes dashboard login skip하는 방법  (0) 2022.03.20
kubernetes dashboard 설치  (0) 2022.03.20
kubernetes 설치  (0) 2022.03.19
minikube service web에서 접속하는 방법  (2) 2022.03.16
minikube 클러스터 설치  (0) 2022.03.13

댓글