728x90
반응형

쿠버네티스 클러스터를 구성하기 위해서는
컨테이너 네트워크 인터페이스(CNI) 도 같이 구성해야 한다고 한다.
그 중에서 나는 컨테이너 네트워크 인터페이스인 Calico 를 적용해서 네트워크를 구성하려고 한다.

일단 마스터노드에서 현재 pod 상태를 전부 확인해보면

[root@k8s-master ~]# kubectl get pod --all-namespaces
NAMESPACE     NAME                                 READY   STATUS    RESTARTS   AGE
kube-system   coredns-78fcd69978-fzpb2             0/1     Pending   0          26m
kube-system   coredns-78fcd69978-pmfnb             0/1     Pending   0          26m
kube-system   etcd-k8s-master                      1/1     Running   0          26m
kube-system   kube-apiserver-k8s-master            1/1     Running   0          26m
kube-system   kube-controller-manager-k8s-master   1/1     Running   0          26m
kube-system   kube-proxy-dflx6                     1/1     Running   0          26m
kube-system   kube-proxy-hsplw                     1/1     Running   0          5m50s
kube-system   kube-proxy-vv9gl                     1/1     Running   0          6m14s
kube-system   kube-scheduler-k8s-master            1/1     Running   0          26m

coredns 와 관련된 pod 2개만 Pending 상태인 것을 확인할 수 있다.

calico 설치와 관련된 내용은 아래의 사이트에서
여러 환경에서 설치하는 방법이 나와있다.

https://docs.projectcalico.org/getting-started/kubernetes/

 

Kubernetes

Get Calico up and running in your Kubernetes cluster.

docs.projectcalico.org

 

내가 구성환 환경에서 calico 를 적용하려면 Calico networking manifest 를 다운로드 받아 적용하던가

curl https://docs.projectcalico.org/manifests/calico.yaml -O

kubectl apply -f calico.yaml

또는 url을 통해 적용하면 된다.

kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml

나는 따로 calico 를 수정하지 않고 적용할 것이기 때문에 url 을 통해 마스터 노드에서 적용해주었다.

[root@k8s-master ~]# kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
configmap/calico-config created
customresourcedefinition.apiextensions.k8s.io/bgpconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/bgppeers.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/blockaffinities.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/clusterinformations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/felixconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/globalnetworkpolicies.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/globalnetworksets.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/hostendpoints.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamblocks.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamconfigs.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ipamhandles.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/ippools.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/kubecontrollersconfigurations.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/networkpolicies.crd.projectcalico.org created
customresourcedefinition.apiextensions.k8s.io/networksets.crd.projectcalico.org created
clusterrole.rbac.authorization.k8s.io/calico-kube-controllers created
clusterrolebinding.rbac.authorization.k8s.io/calico-kube-controllers created
clusterrole.rbac.authorization.k8s.io/calico-node created
clusterrolebinding.rbac.authorization.k8s.io/calico-node created
daemonset.apps/calico-node created
serviceaccount/calico-node created
deployment.apps/calico-kube-controllers created
serviceaccount/calico-kube-controllers created
Warning: policy/v1beta1 PodDisruptionBudget is deprecated in v1.21+, unavailable in v1.25+; use policy/v1 PodDisruptionBudget
poddisruptionbudget.policy/calico-kube-controllers created

이제 calico 를 적용했으니 확인해본다.

[root@k8s-master ~]# kubectl get pod --all-namespaces
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
kube-system   calico-kube-controllers-58497c65d5-hkrjp   1/1     Running   0          73s
kube-system   calico-node-f88km                          1/1     Running   0          73s
kube-system   calico-node-p9zrh                          1/1     Running   0          73s
kube-system   calico-node-z6d2h                          1/1     Running   0          73s
kube-system   coredns-78fcd69978-fzpb2                   1/1     Running   0          41m
kube-system   coredns-78fcd69978-pmfnb                   1/1     Running   0          41m
kube-system   etcd-k8s-master                            1/1     Running   0          42m
kube-system   kube-apiserver-k8s-master                  1/1     Running   0          42m
kube-system   kube-controller-manager-k8s-master         1/1     Running   0          42m
kube-system   kube-proxy-dflx6                           1/1     Running   0          41m
kube-system   kube-proxy-hsplw                           1/1     Running   0          21m
kube-system   kube-proxy-vv9gl                           1/1     Running   0          21m
kube-system   kube-scheduler-k8s-master                  1/1     Running   0          42m

모든 pod 가 잘 작동하고 있는 것을 확인했다.
아까는 coredns pod 가 보류상태였는데 지금은 잘 작동하고 있다.

calico 적용 끝 !

728x90
반응형
복사했습니다!