Problems faces to The ultimate CKAD mock exam series on KodeKloud!

Hi I have 3 questions from lab-cka-mock-exam-5 that not work even i put the solution that you have proposed but there are not work.**

Question :

SECTION: TROUBLESHOOTING

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

kubectl config use-context cluster4

There is a pod called pink-pod-cka16-trb created in the default namespace in cluster4. This app runs on port tcp/5000 and it is exposed to end-users using an ingress resource called pink-ing-cka16-trb in such a way that it is supposed to be accessible using the command: curl http://kodekloud-pink.app on cluster4-controlplane host.

However, this is not working. Troubleshoot and fix this issue, making any necessary to the objects.

Note: You should be able to ssh into the cluster4-controlplane using ssh cluster4-controlplane command.

SOLUTION

SSH into the cluster4-controlplane host and try to access the app.
ssh cluster4-controlplane
curl kodekloud-pink.app

You must be getting 503 Service Temporarily Unavailabl error.
Let’s look into the service:

kubectl edit svc pink-svc-cka16-trb
  • Under ports: change protocol: UDP to protocol: TCP

Try to access the app again

curl kodekloud-pink.app

You must be getting curl: (6) Could not resolve host: example.com error, from the error we can see that its not able to resolve example.com host which indicated that it can be some issue related to the DNS. As we know CoreDNS is a DNS server that can serve as the Kubernetes cluster DNS, so it can be something related to CoreDNS.

Let’s check if we have CoreDNS deployment running:

kubectl get deploy -n kube-system

You will see that for coredns all relicas are down, you will see 0/0 ready pods. So let’s scale up this deployment.

kubectl scale --replicas=2 deployment coredns -n kube-system

Once

CoreDBS is up let’s try to access to app again.

curl kodekloud-pink.app

It should work now.

SO; it’s not work for me. I still have the errors:

cluster4-controlplane ~ ➜ curl http://kodekloud-pink.app

404 Not Found

404 Not Found


nginx


QUESTION2

Question

SECTION: SERVICE NETWORKING

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

kubectl config use-context cluster3

Create a loadbalancer service with name wear-service-cka09-svcn to expose the deployment webapp-wear-cka09-svcn application in app-space namespace.

  • SolutionSwitch to cluster3 :
kubectl config use-context cluster3

On student node run the command:

student-node ~ ➜  kubectl expose -n app-space deployment webapp-wear-cka09-svcn --type=LoadBalancer --name=wear-service-cka09-svcn --port=8080
service/wear-service-cka09-svcn exposed
student-node ~ ➜  k get svc -n app-space
NAME                      TYPE           CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE
wear-service-cka09-svcn   LoadBalancer   10.43.68.233   172.25.0.14   8080:32109/TCP   14s

SCREEN

SO; it’s not work for me. I still have the errors:

kubectl expose -n app-space deployment webapp-wear-cka09-svcn --type=LoadBalancer --name=wear-service-cka09-svcn --port=8080

Error from server (NotFound): namespaces “app-space” not found

I a create the namespace, I have this error after:

student-node ~ ➜ k expose deployment webapp-wear-cka09-svcn -n app-space --type=loadbalancer --name=wear-service-cka09-svcn

Error from server (NotFound): deployments.apps “webapp-wear-cka09-svcn” not found


QUESTION3

kubectl run test-nslookup --image=busybox:1.28 --rm -it --restart=Never – nslookup nginx-resolver-service-cka06-svcn > /root/CKA/nginx.svc.cka06.svcn

-su: /root/CKA/nginx.svc.cka06.svcn: No such file or directory

student-node ~ :heavy_multiplication_x: touch /root/CKA/nginx.pod.cka06.svcntouch: cannot touch ‘/root/CKA/nginx.pod.cka06.svcn’: No such file or directory

Hello

Your questions:

  1. There is a known issue with this. An internal ticket is open with the labs team

  2. Needs to be LoadBalancer not loadbalancer

    k expose deployment webapp-wear-cka09-svcn -n app-space --type=LoadBalancer --name=wear-service-cka09-svcn
    service/wear-service-cka09-svcn exposed
    
  3. Like this

    student-node ~ ➜  k run nginx-resolver-cka06-svcn --image nginx
    pod/nginx-resolver-cka06-svcn created
    
    student-node ~ ➜  k expose pod nginx-resolver-cka06-svcn --port 80 --name nginx- 
    resolver-service-cka06-svcn --type ClusterIP
    service/nginx-resolver-service-cka06-svcn exposed
    
    student-node ~ ➜  k run test --image busybox:1.28 --rm -i --restart Never --command -- 
    nslookup nginx-resolver-service-cka06-svcn > /root/CKA/nginx.svc.cka06.svcn
    If you don't see a command prompt, try pressing enter.
    Error attaching, falling back to logs: unable to upgrade connection: container test not 
    found in pod test_default
    
    student-node ~ ➜  cat /root/CKA/nginx.svc.cka06.svcnServer:    10.96.0.10
    Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
    
    Name:      nginx-resolver-service-cka06-svcn
    Address 1: 10.102.158.169 nginx-resolver-service-cka06-svcn.default.svc.cluster.local
    pod "test" deleted
    
    student-node ~ ➜  k get po -o wide
    # Output not shown here, but you need IP address of the pod
    
    student-node ~ ✖ k run test --image busybox:1.28 --rm -i --restart Never --command -- 
    nslookup 10-244-192-2.default.pod > /root/CKA/nginx.pod.cka06.svcn
    
    student-node ~ ➜  cat /root/CKA/nginx.pod.cka06.svcn 
    Server:    10.96.0.10
    Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
    
    Name:      10-244-192-2.default.pod
    Address 1: 10.244.192.2 10-244-192-2.nginx-resolver-service-cka06- 
    svcn.default.svc.cluster.local
    pod "test" deleted