✏️ 칼리코
- 칼리코는 CNI 의 구현체중 하나이다.
- CNI 는 Container Network Interface 의 약자로 Master Node 와 Worker Node 를 같은 네트워크로 묶어주는 방식을 뜻한다.
- kubernetes 에도 기본적으로 CNI 가 설치되어있긴 하지만 성능이 좋지 않아 다른 구현체를 사용하는 것이 편하다.
📍 칼리코 설치
kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.24.1/manifests/tigera-operator.yaml
📍 환경설정
mkdir /kube && cd /kube
vim calico-resources.yaml
apiVersion: operator.tigera.io/v1
kind: Installation
metadata:
name: default
spec:
calicoNetwork:
bgp: Disabled
ipPools:
- blockSize: 26
cidr: 10.10.0.0/16
natOutgoing: Enabled
encapsulation: VXLAN
---
apiVersion: operator.tigera.io/v1
kind: APIServer
metadata:
name: default
spec: {}
📍 pod 생성
- 추가해준 환경설정 파일을 기준으로 pod 를 생성시키는 명령어이다.
kubectl create -f calico-resources.yaml
📍 containerd 다시 시작
- 모든 server 에서 다시 시작해줘야 한다.
systemctl restart containerd
📍 확인하기
- pod 의 상태를 확인해보면 처음과 달라진것을 확인할 수 있다.
kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
calico-apiserver calico-apiserver-86f6645f8d-hldlg 0/1 ContainerCreating 0 2s
calico-apiserver calico-apiserver-86f6645f8d-n7c7m 0/1 ContainerCreating 0 2s
calico-system calico-kube-controllers-6dfbf88686-drrfl 1/1 Running 0 67s
calico-system calico-node-wb82r 1/1 Running 0 67s
calico-system calico-typha-77cbf7c869-r269p 1/1 Running 0 68s
calico-system csi-node-driver-49nln 0/2 ContainerCreating 0 29s
kube-system coredns-5d78c9869d-qwc65 1/1 Running 0 95m
kube-system coredns-5d78c9869d-t7rfv 1/1 Running 0 95m
kube-system etcd-master 1/1 Running 3 95m
kube-system kube-apiserver-master 1/1 Running 3 95m
kube-system kube-controller-manager-master 1/1 Running 3 95m
kube-system kube-proxy-9q59n 1/1 Running 0 95m
kube-system kube-scheduler-master 1/1 Running 3 95m
tigera-operator tigera-operator-7bf7458-7vdnn 1/1 Running 0 78s
- 맨 앞에
watch
를 붙이면 실시간 상황을 확인할 수 있다.
- 하나씩 running 이 완료되면서 조금 기다리면 모든 pod 들이 running 으로 바뀐다.
watch kubectl get pods -n calico-system
- 모든 pod 가 running 으로 바뀌면 성공이다.
- 다시 node 를 확인해보면 ready 로 상태가 바뀐것을 확인할 수 있다.
kubectl get nodes
NAME STATUS ROLES AGE VERSION
master Ready control-plane 99m v1.27.3