Anushka hasini:
Hi, How to configure correct config file path for Kubeproxy. Because I am not able to see any kubeproxy folder inside /var/lib directory. Can someone help me to finish this one.
Mohamed Ayman:
Hello @Anushka hasini,
This file is inside the pod. try to exec into the pod first kubectl exec -it -n kube-system <kube-proxy-pod-name> -- /bin/sh
-
Check the logs of the
kube-proxy pods
kubectl -n kube-system logs <name_of_the_kube_proxy_pod>
-
The configuration file /var/lib/kube-proxy/configuration.conf is not valid. The configuration path does not match the data in the ConfigMap.
kubectl -n kube-system describe configmap kube-proxy
shows that the file name used is config.conf which is mounted in the kube-proxy daemonset pods at the path /var/lib/kube-proxy/config.conf -
However in the DaemonSet for kube-proxy, the command used to start the kube-proxy pod makes use of the path /var/lib/kube-proxy/configuration.conf.
Correct this path to /var/lib/kube-proxy/config.conf as per the ConfigMap and recreate the kube-proxy pods.
This should get the kube-proxy pods back in a running state.
Anushka hasini:
Where should I correct this path, I mean which file
Anushka hasini:
Got it now. Thanks
Mohamed Ayman:
Welcome, and happy learning!
Anushka hasini:
Hi, How should one know whether cluster has network addon installled or not
Anushka hasini:
Do we have any commands to verify it
Mohamed Ayman:
Try this to check is there a network add-on pods or not kubectl get pod -n kube-system
Anushka hasini:
Yeah, But I thought kube-proxy is a network components
Anushka hasini:
Do we need to install weave net for accessing services over network
Anushka hasini:
Hi, I have given kubectl get pods -n kube-system
Anushka hasini:
I am getting output like this
Anushka hasini:
root@controlplane:/# k get pods -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-74ff55c5b-v7mq2 1/1 Running 0 63m
coredns-74ff55c5b-wz8gr 1/1 Running 0 63m
etcd-controlplane 1/1 Running 0 63m
kube-apiserver-controlplane 1/1 Running 0 63m
kube-controller-manager-controlplane 1/1 Running 0 63m
kube-proxy-jjtql 0/1 CrashLoopBackOff 1 19s
kube-scheduler-controlplane 1/1 Running 0 63m
weave-net-h6jd8 2/2 Running 0 61s
Anushka hasini:
I am not able to go inside kube-proxy container. It says below error msg
Anushka hasini:
root@controlplane:/# kubectl exec -it -n kube-system kube-proxy-jjtql – /bin/sh
error: unable to upgrade connection: container not found (“kube-proxy”)
Pierpaolo P:
Please next time format the terminal output as code, like that
NAME READY STATUS RESTARTS AGE
coredns-74ff55c5b-v7mq2 1/1 Running 0 63m
coredns-74ff55c5b-wz8gr 1/1 Running 0 63m
etcd-controlplane 1/1 Running 0 63m
kube-apiserver-controlplane 1/1 Running 0 63m
kube-controller-manager-controlplane 1/1 Running 0 63m
kube-proxy-jjtql 0/1 CrashLoopBackOff 1 19s
kube-scheduler-controlplane 1/1 Running 0 63m
weave-net-h6jd8 2/2 Running 0 61s
First of all double check the logs, then in kube-system
namespace you can find a kube-proxy
configmap.
In the cm there are 2 entries related to the proxy configuration. Double check the entry withe the one in the .yaml file
Shwetha:
logs, pod events tell you whats wrong with the pod in most cases. If that doesnt help, like Pita suggested have a look at the config provided (config maps, cmd, args etc. )
Anushka hasini:
ok thank you