ㅁ In this practice test we will install weave-net POD networking solution to the cluster. Let us first inspect the setup.
We have deployed an application called app in the default namespace. what is the state of the pd?
[NOT RUNNING]
$ kubectl get pod
NAME READY STATUS RESTARTS AGE
app 0/1 ContainerCreating 0 2m15s
ㅁ Inpect why the POD is not running
[Wrong image]
[Faulty start command]
[Node failed]
[No Network Configured]
$ kubectl describe pod app
$ kubectl describe pod app
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 4m5s default-scheduler Successfully assigned default/app to node01
Warning FailedCreatePodSandBox 4m3s kubelet, node01 Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "693a6f7ef3f8e1c40bcbd6f236b0abc154090ae389862989ddb5abee956624a8" network for pod "app": networkPlugin cni failed to set up pod "app_default" network: unable to allocate IP address: Post "http://127.0.0.1:6784/ip/693a6f7ef3f8e1c40bcbd6f236b0abc154090ae389862989ddb5abee956624a8": dial tcp 127.0.0.1:6784: connect: connection refused, failed to clean up sandbox container "693a6f7ef3f8e1c40bcbd6f236b0abc154090ae389862989ddb5abee956624a8" network for pod "app": networkPlugin cni failed to teardown pod "app_default" network: Delete "http://127.0.0.1:6784/ip/693a6f7ef3f8e1c40bcbd6f236b0abc154090ae389862989ddb5abee956624a8": dial tcp 127.0.0.1:6784: connect: connection refused]
Normal SandboxChanged 7s (x19 over 4m3s) kubelet, node01 Pod sandbox changed, it will be killed and re-created.
ㅁ Deploy weave-net networking solution to the cluster
아래 weave-net 설치 경로를 찾기 위해서는 installing addon을 검색하여 weave-net을 찾는다.
kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
serviceaccount/weave-net created
clusterrole.rbac.authorization.k8s.io/weave-net created
clusterrolebinding.rbac.authorization.k8s.io/weave-net created
role.rbac.authorization.k8s.io/weave-net created
rolebinding.rbac.authorization.k8s.io/weave-net created
daemonset.apps/weave-net created
$ kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
default app 1/1 Running 0 7m16s
kube-system coredns-f9fd979d6-d5fv4 1/1 Running 0 9m27s
kube-system coredns-f9fd979d6-hrz9w 1/1 Running 2 9m42s
kube-system etcd-controlplane 1/1 Running 0 61m
kube-system kube-apiserver-controlplane 1/1 Running 0 61m
kube-system kube-controller-manager-controlplane 1/1 Running 0 61m
kube-system kube-proxy-dflgk 1/1 Running 0 61m
kube-system kube-proxy-zk6gm 1/1 Running 1 61m
kube-system kube-scheduler-controlplane 1/1 Running 0 61m
kube-system weave-net-22vm6 2/2 Running 0 35s
kube-system weave-net-vdjrs 2/2 Running 0 35s
'CKA &. CKAD > Networking' 카테고리의 다른 글
Service Networking (0) | 2021.03.31 |
---|---|
Practice Test - Networking Weave (0) | 2021.03.31 |
Practice Test - Explore CNI weave (0) | 2021.03.31 |
WeaveWorks (CNI) (0) | 2021.03.31 |
CNI in Kubernetes (0) | 2021.03.31 |