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:
changeprotocol: UDP
toprotocol: 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 ~ touch /root/CKA/nginx.pod.cka06.svcntouch: cannot touch ‘/root/CKA/nginx.pod.cka06.svcn’: No such file or directory