In questions related to modifying /etc/kubernetes/manifests/kube-apiserver.yaml for tasks such as defining audit policy log etc Mock exam 3 Q2 … I have correctly added the audit log path and save the yaml file. However after that when i run any kubectl command i get issue related to connection to controlplane refused…
I have restarted the kubelet service by # systemctl restart kubelet command. still no luck .
This has been happening to me in almost all question so need to know what am i missing.
Kind help …
Hi rohitmailbox9
Looks like your kube-apiserver is not coming up.
It may due to something wrong with your update.
kube-apiserver.yaml is very sensitive. Even a space may sometimes effect it.
Take the backup of kube-apiserver.yaml & update it
cp /etc/kubernetes/manifests/kube-apiserver.yaml ~/1-kube-apiserver.yaml.orig
vim /etc/kubernetes/manifests/kube-apiserver.yaml
Try to stop & start kube-apiserver:
cd /etc/kubernetes/manifests
mv kube-apiserver.yaml …
mv …/kube-apiserver.yaml .
If kube-apiserver is not coming up after modifications & normal wait time, then check the logs(below is an example):
controlplane $ cd /var/log/pods/kube-system_kube-apiserver-controlplane_80ec794cc4ee54b7604a6564c4e2604b/
controlplane $ ls
kube-apiserver
controlplane $ cd kube-apiserver/
controlplane $ ls
0.log or 1.log or 2.log etc. [refer the log for some hints]
controlplane $
hope this helps.
Thank you.