Hi All, Need help as I am not able to understand the solution mentioned for Pra . .

Kamal Verma:
Hi All,

Need help as I am not able to understand the solution mentioned for Practice Test - Troubleshoot Network in CKA Course.

Section 13: Troubleshooting -> Practice Test - Troubleshoot Network - Question 2

I can see from Kube-proxy logs below error

controlplane $ kubectl logs -f kube-proxy-4zwst -n kube-system
F0630 20:12:55.120890 1 server.go:490] failed complete: open /var/lib/kube-proxy/configuration.conf: no such file or directory

I have check the DeamonSet for Kubeproxy and I could see Config map is mount on Kubeproxy DS.

In Configmap also the kubeconfig: /var/lib/kube-proxy/kubeconfig.conf and this path does not exists.


controlplane $ kubectl describe cm kube-proxy -n kube-system
Name: kube-proxy
Namespace: kube-system
Labels: app=kube-proxy
Annotations: http://kubeadm.kubernetes.io/component-config.hash|kubeadm.kubernetes.io/component-config.hash: sha256:fd1719f5b165f8b868725bb0f9ee65a6d1f27d4d833791d68a51a731cb8d20be

Data

config.conf:

apiVersion: http://kubeproxy.config.k8s.io/v1alpha1|kubeproxy.config.k8s.io/v1alpha1
bindAddress: 0.0.0.0
bindAddressHardFail: false
clientConnection:
acceptContentTypes: “”
burst: 0
contentType: “”
kubeconfig: /var/lib/kube-proxy/kubeconfig.conf
qps: 0

Please help me to understand the exact reason for the issue.

Thanks,
Kamal

1 Like

Phani M:
Hi @Kamal Verma if you look at the config map for kube-proxy by doing

controlplane $ k get cm kube-proxy -n kube-system -o yaml
apiVersion: v1
data:
  config.conf: |-
    apiVersion: <http://kubeproxy.config.k8s.io/v1alpha1|kubeproxy.config.k8s.io/v1alpha1>

the first item in data portion says config.conf

whereas in the daemonset yaml manifest, the --config refers to

/var/lib/kube-proxy/configuration.conf

If you look at the VolumeMounts for the daemonset, the configuration is being mounted from the configMap.
So in order to make the kube-proxy pods to be up and running, do this:

  1. k edit ds kube-proxy -n kube-system
  2. change the --config path as /var/lib/kube-proxy/config.conf
  3. check the kube-proxy pods should be in Running status in the kube-system namespace
    Hope this clears your question
2 Likes

This is a problem, because not exist folder “/var/lib/kube-proxy/” in server

1 Like

The directory “/var/lib/kube-proxy” is not present on the server.

The solution explain for this ‘lab’ is badly clear.

The folder ‘var/lib/kube-proxy/’ is not present in controlplane node but inside the runnig kube-proxy pod.

You can check the folder/file within pod, accessing it directly:

kubectl exec -it kube-proxy-XXXXX -n kube-system – /bin/sh

Once inside the pod you can check then

ls -l /var/lib/kube-proxy/

1 Like

This is something tricky and you will not find a solution video for this lab.

Here you need to know kube-proxy default configuration file location and file name.
Then you need to edit the daemon set yaml file.

k edit -n kube-systems ds kube-proxy

  • –config=/var/lib/kube-proxy/config.conf

The solutions to this lab are here