Hello,
The solution to the exercise is wrong. See the cm name in the solution and the real cm in the lab
Hello,
The solution to the exercise is wrong. See the cm name in the solution and the real cm in the lab
No, the solution is actually correct. Take a look at the volumes block for a kube-proxy pod; the cm is mounted to /var/lib/kube-proxy. If you look at the contents of the cm, you’ll see that it encodes two separate files, which the fixed ds.kube-proxy needs to reference. The solution has you change the config from /var/lib/configuration.conf to /var/lib/config.conf, which fixes kube-proxy. The reference you show in the right side of your image is the correct reference of config.conf to the kubeconfig file that kube-proxy also needs to operate. That kubeconfig file is also embedded in the cm. So this is all fine.
How do I get that info, i.e. how do I know that the real path and file is /var/lib/config.conf
From the YAML of ds.kube-proxy, you can tell that the cm is mounted into the pod as /var/lib/kube-proxy. You look at the CM, and see that the cm encodes two separate files, config.conf, and kubeconfig.conf. The latter of these is clearly a kubeconfig file (you can see this by looking at the text of it). So the only possible valid path for the config file is /var/lib/kube-proxy/config.conf; the path /var/lib/kube-proxy/configuration.conf must be wrong.
Hello @rob_kodekloud
sorry, I still do not get where to get /var/lib/config.conf
from
Config map for kube-proxy:
Daemon et volumes:
Thanks
Look at the mounts for a kube-proxy pod. Here’s what a kube-proxy pod looks like on my minikube install:
$ minikube ssh
_ _
_ _ ( ) ( )
___ ___ (_) ___ (_)| |/') _ _ | |_ __
/' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)
$ sudo -i
# ps -aef | grep kube-proxy
root 1918 1889 0 Dec12 ? 00:01:05 /usr/local/bin/kube-proxy --config=/var/lib/kube-proxy/config.conf --hostname-override=minikube
root 1955734 1955671 0 18:52 pts/0 00:00:00 grep kube-proxy
# ls /proc/1918/root/var/lib/kube-proxy/
config.conf kubeconfig.conf
The problem in the question is that you start out with passing the kube-proxy binary `–config=/var/lib/kube-proxy/configuration.conf; under the mounts created for that pod (which mount /var/lib/kube-proxy into the configmap kube-proxy), there is no such file as /var/lib/kube-proxy/configuration.conf. Which is why kube-proxy is in a crash state. We see from your graphic that the config.conf file in the cm is in fact a config YAML for kube-proxy, so we use that instead.