Hi @santosh.arvind,
Exercise 1:
1st step, I checked the mysql pod and see it stuck in the ContainerCreating
state.
k get po mysql -n triton
NAME READY STATUS RESTARTS AGE
mysql 0/1 ContainerCreating 0 84s
Then I describe
the pod
to see what went wrong.
root@controlplane:/# k describe po mysql -n triton
Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "ec66faed761a8e1a32f71ffc19f6681f1cc3834f0b2b662151f8a6e30b1872a1" network for pod "mysql": networkPlugin cni failed to set up pod
The error message then directs me to check the network addon.
root@controlplane:/# kubectl get po -n kube-system
Confirmed the network addon mission, need to install one (weave could be good candidate).
Use below command to install weave:
curl -L https://github.com/weaveworks/weave/releases/download/latest_release/weave-daemonset-k8s-1.11.yaml | kubectl apply -f -
root@controlplane:/# k get po -n kube-system
NAME READY STATUS RESTARTS AGE
weave-net-rq5pc 2/2 Running 0 29s
Wait for a while and check the pod in the kube-system namespace again, confirm the weave pods running.
Come back and check the mysql pod, it should be transitioned to a Running
state now.
root@controlplane:/# k get po -n triton
NAME READY STATUS RESTARTS AGE
mysql 1/1 Running 0 7m8s
webapp-mysql-54db464f4f-z46k6 1/1 Running 0 7m7s
Check the app link and confirm it worked.
Exercise 2:
Should be quicker than the 1st one, I checked db pod, web pod, they all running ok. Then check the svc, they all have correct endpoints.
So move to check kube-system pod, I see the problem with kube-proxy.
After checking logs, we can see the problem with kube proxy, so going to fix it by getting the current yaml of the proxy DS.
Then correct the configuration path, and apply the change.
containers:
- command:
- /usr/local/bin/kube-proxy
- --config=/var/lib/kube-proxy/config.conf
After correct, the config, the kube-proxy DS able to run well, and the problem was fixed.
Thanks,
Trung.