728x90
Kubernetes 실습 :: Virtual Machine에서 Kubernetes 설치 (5) 대시보드 생성
1. Kubernetes 클러스터에 노드 추가
ubuntu@k8s-node1:~$ sudo kubeadm join 192.168.56.100:6443 --token mxmi8f.e4q20ddh2xcuax81 \\
--discovery-token-ca-cert-hash sha256:df2b759375f568a72beaac4a5064f510fc145efb01a844769d4c2770c23ff824
2. Master 서버에서 Calico 네트워크 정책을 Kubernetes 클러스터에 배포
- master 서버와 node 서버의 네트워크 설정
- Calico 네트워크 정책: Kubernetes 클러스터에서 네트워크 트래픽을 제어하고 보안을 강화하기 위해 사용되는 도구
ubuntu@k8s-master:~$ curl -O <https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml>
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 232k 100 232k 0 0 249k 0 --:--:-- --:--:-- --:--:-- 249k
ubuntu@k8s-master:~$ kubectl apply -f calico.yaml
<포드 생성 및 라우팅 테이블 확인>
ubuntu@k8s-master:~$ kubectl get pod -A
ubuntu@k8s-master:~$ route -n
3. 토큰 생성 (대시보드 생성 및 관리를 위한 권한)
- 토큰 리스트 확인
ubuntu@k8s-master:~$ kubeadm token list
TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS
mxmi8f.e4q20ddh2xcuax81 22h 2024-02-16T05:43:18Z authentication,signing The default bootstrap token generated by 'kubeadm init'. system:bootstrappers:kubeadm:default-node-token
- 클러스터에 노드를 추가하는 데 사용하는 토큰 생성 및 출력
ubuntu@k8s-master:~$ kubeadm token create --ttl 0 --print-join-command
kubeadm join 192.168.56.100:6443 --token a0w5qc.6wblg32xzr0ohfix --discovery-token-ca-cert-hash sha256:df2b759375f568a72beaac4a5064f510fc145efb01a844769d4c2770c23ff824
- 대시보드를 Kubernetes 클러스터에 배포
ubuntu@k8s-master:~$ kubectl apply -f <https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml>
'클라우드 + DevOps > Kubernetes (k8s)' 카테고리의 다른 글
Kubernetes 실습 :: Kubernetes 대시보드 모니터링 실습 (1) (0) | 2024.04.13 |
---|---|
Kubernetes 실습 :: Virtual Machine에서 Kubernetes 설치 (6) 대시보드 인증서 생성 (1) | 2024.04.12 |
Kubernetes 실습 :: Virtual Machine에서 Kubernetes 설치 (4) swap 영구 비활성화 (0) | 2024.04.10 |
Kubernetes 실습 :: Virtual Machine에서 Kubernetes 설치 (3) node 서버 생성 (0) | 2024.04.09 |
Kubernetes 실습 :: Virtual Machine에서 Kubernetes 설치 (2) master 서버 설정 (0) | 2024.04.08 |