Need help on this : CKAD course > Kubernetes challenges > Challenge 2

Hi,

I’m training with the k8s challenges proposed in the CKAD course and I’m struggling directly at the beginning of Challenge 2 (Kubernetes Challenges Course | KodeKloud).
We need to fix kube config and kube-apiserver to be able to access the cluster (at this point I cannot access neither with a curl request nor using kubectl commands) but except the wrong port contained in /root/.kube/config that I fixed, I don’t see how to do it.

Regarding kub-apiserver, the related certificates exist in /pki subfolder and the IP addresses seem good.

Any hint on this one please ?

Thank you in advance.
Mathieu Ridet

Hi @mathieuridet

When you try to get any resources on the cluster you get this error:

controlplane ~ ➜  k get no
E0205 09:21:54.897210   15528 memcache.go:265] couldn't get current server API group list: Get "https://controlplane:6433/api?timeout=32s": dial tcp 192.168.239.27:6433: connect: connection refu

You can see the the address https://controlplane:6433/*** This needs to be 6443. You can use vi editor and fix this in /root/.kube/config.

Still the cluster is in broken state. We check the kube-apiserver Pod logs in /var/log/pods/kube-system_kube-apiserver-controlplane_xxx/kube-apiserver/x.log


controlplane pods/kube-system_kube-apiserver-controlplane_0b0756610207980ca7233977cd07a6e1/kube-apiserver ✖ cat 8.log 
2025-02-05T09:27:18.39231465Z stderr F I0205 09:27:18.392134       1 options.go:221] external host was not specified, using 192.168.239.27
2025-02-05T09:27:18.393719862Z stderr F I0205 09:27:18.393586       1 server.go:148] Version: v1.30.0
2025-02-05T09:27:18.393876729Z stderr F I0205 09:27:18.393816       1 server.go:150] "Golang settings" GOGC="" GOMAXPROCS="" GOTRACEBACK=""
2025-02-05T09:27:19.309802021Z stderr F E0205 09:27:19.309530       1 run.go:74] "command failed" err="open /etc/kubernetes/pki/ca-authority.crt: no such file or directory"

We see err=“open /etc/kubernetes/pki/ca-authority.crt: no such file or directory” We fix the cert file name in the kube-apiserver YAML in line with the one used in the certs directory and the Cluster should come up.

Thank you for your help !
I managed to finish the lab with success :slight_smile: