반응형
1. dashboard apply
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.5.0/aio/deploy/recommended.yaml
2. proxy 및 접근
kubectl proxy
http://localhost:8001/api/v1/namespaces/kubernewtes-dashboard/services/https://kubernetes-dashboard:/proxy
3. dashboard secret 설정
kubectl apply -f - <<EOF
apiVersion: v1
kind: Secret
metadata:
name: default-token
namespace: kubernetes-dashboard
annotations:
kubernetes.io/service-account.name: default
type: kubernetes.io/service-account-token
EOF
secret/default-token created
4. token 가져오기
kubectl describe secret default-token | grep -E '^token'
token: ehfibwoierytobk659khk304tk0NfG3rko...
5. dashboard token에 붙여넣기
6. admin-user 생성
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
7. role binding
kubectl create clusterrolebinding serviceaccounts-cluster-admin --clusterrole=cluster-admin --group=system:serviceaccounts
8. test - create deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
selector:
matchLabels:
app: nginx
replicas: 2
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80
9. 배포 화면
참고 문서
https://kubernetes.io/ko/docs/tasks/access-application-cluster/access-cluster/
반응형
'kubernetes' 카테고리의 다른 글
install kubernetes cluster 1.25.2 on local ubuntu, centos (0) | 2022.10.09 |
---|---|
쿠버네티스 버전 낮추기(설정하기) - minikube (0) | 2022.08.15 |
kubernetes localhost 연결 - sonarqube (0) | 2022.07.21 |
k8s: yaml 파일 구조 - 2 (0) | 2022.05.31 |
k8s: minikube 클러스터 만들기 - 1 (0) | 2022.05.18 |