Mock Exam 3 (CKA) cannot find service?

For this question, please set the context to cluster3 by running:

kubectl config use-context cluster3

We have an external webserver running on student-node which is exposed at port 9999. We have created a service called external-webserver-cka03-svcn that can connect to our local webserver from within the kubernetes cluster3 but at the moment it is not working as expected.

Fix the issue so that other pods within cluster3 can use external-webserver-cka03-svcn service to access the webserver.

Endpoints exists for external-webserver-cka03-svcn service ?

Correct Ip address specified?

Correct port specified ?

student-node ~ ➜ kubectl config use-context cluster3
Switched to context “cluster3”.

student-node ~ ➜ k get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.43.0.1 443/TCP 134m
hr-web-app-cka08-svcn NodePort 10.43.189.50 8080:30082/TCP 42m

student-node ~ ➜ curl student-node:9999

Welcome to nginx! html { color-scheme: light dark; } body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; }

Welcome to nginx!

If you see this page, the nginx web server is successfully installed and working. Further configuration is required.

For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.

Thank you for using nginx.

student-node ~ ➜ k get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.43.0.1 443/TCP 136m
hr-web-app-cka08-svcn NodePort 10.43.189.50 8080:30082/TCP 44m

student-node ~ ➜ ssh cluster3-controlplane

cluster3-controlplane ~ ➜ k get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.43.0.1 443/TCP 136m
hr-web-app-cka08-svcn NodePort 10.43.189.50 8080:30082/TCP 44m

cluster3-controlplane ~ ➜ ls

cluster3-controlplane ~ ➜ cd ~

cluster3-controlplane ~ ➜ ls

cluster3-controlplane ~ ➜ k get svc external-webserver-cka03-svcn
Error from server (NotFound): services “external-webserver-cka03-svcn” not found

cluster3-controlplane ~ :heavy_multiplication_x:

Could you please correct me if i am wrong?

Thanks in Advance

Regards,
MK

Hi @Mohan1806

Can you please share the Question No?

You can share the screenshot from the lab showing the actions you performed, or if you intend to share the logs that can be enclosed in a codeblock available with </> button on the editor. That will help us a lot to assist you.

Are you in the correct namespace?
Does kubectl get svc -A show it?

Hi KodeKloud Team,
Thank You for your prompt response and valuable time it is working now. Below mentioned screenshot that service is available in kube-public namespace.

Regards,
Mohan