+++++ 버전: Dashboard v2.4.0+0.ge75ebcf68 +++++
1. Manifest(yaml) 파일 다운로드
> wget https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml
2. 적용
> kubectl apply -f recommanded.yaml
3. dashboard ingress 생성
> vi dashboard-ingress.yaml
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: kubernetes-dashboard
name: kubernetes-dashboard-ingress
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
nginx.ingress.kubernetes.io/ssl-passthrough: "true"
# Uncomment next if you use https://cert-manager.io/
#cert-manager.io/cluster-issuer: "<YOUR CLUSTER ISSUER>"
spec:
tls:
- hosts:
- dashboard.k8s.stage
secretName: kubernetes-dashboard-cert
rules:
- host: dashboard.k8s.stage
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kubernetes-dashboard
port:
number: 443
---
> kubectl apply -f dashboard-ingress.yaml
4. 계정 및 토큰 생성
4.1 계정 생성
> vi kubernetes-dashboard-service-account.yam
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: admin
subjects:
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
---
4.2 Secret(토큰) 생성
> vi admin-user-acoount-token.yaml
---
apiVersion: v1
kind: Secret
type: kubernetes.io/service-account-token
metadata:
name: admin-user-account-token
namespace: kubernetes-dashboard
annotations:
kubernetes.io/service-account.name: admin-user
---
> kubectl apply -f admin-user-acoount-token.yaml
4.3 token 확인
> kubectl describe secret admin-user-account-token -n kubernetes-dashboard
4.4 임시 token 생성
> kubectl -n kubernetes-dashboard create token admin-user
5. kubernetes-dashboard 삭제
> kubectl delete -f recommended.yaml
'가상화 > Kubernetes' 카테고리의 다른 글
[Docker] Tomcat 컨테이너 Heap 모니터링 (0) | 2020.04.18 |
---|---|
[kubernetes] Kubernetes에 SQL Server 컨테이너 배포 (0) | 2020.04.17 |
[docker] mssql server 및 tools 설치 (0) | 2020.04.16 |
[kubernetes] 외부 nginx + kubernetes tomcat 연동 (0) | 2020.04.15 |
[kubernetes] Kubernetes에서 Ingress 와 Tomcat 연동 (0) | 2020.04.10 |