CKAD Mock Exam 4 - Q.10

Hi, problems with:

Q.10:
I just edit the nginx controller fixing the problem, next the exam checker gives me green flag on path, but red for controller issue. Am I obliged to copy config to file, delete manually the controller and recreate? why?

thanks

What did you “fix” in the controller? In particular, after you “fixed” the controller, was it running? This one’s a little tricky; it isn’t necessarily obvious what you need to fix.

i’ve just edited the namespace part in the nginx controller startup coimmand line, then fixed the paths in the ingress.
The fact that paths are flagged as green should demonstrate rightfulness as per question statement.

Here’s what I"m fishing for: the reason the IC wasn’t working is a little unusual. What “paths” did you fix, and why? Also, are you sure the IC was actually running after you made the fix? The answer is fairly clear, but only if you looked in the log of the IC’s pod. Did you?

The ingress resource’s paths are a different issue.

The exercise in the beginning, shows u a scenario with crashed status of IC.

You need to fix the path of the IC’s args:

–default-backend-service=default/default-backend-service

become:

–default-backend-service=green-space/default-backend-service

Now, after the IC deploy editing, the structure turns into a consistent state, which now allows me to update the Ingress that must be fixed from exercise text (2 paths of the ingress must be adjusted).
Without a fully working IC, all the modifications of this Ingress are rejected obviously.

So now, can u explain me why i don’t fully pass the exercise?
Since i saw that the IC was in RUNNING state, the Ingress edit started working and the paths were rightly answering, why should i check logs?
In any case I’ve also retried and I didn’t notice anything:


NGINX Ingress controller
Release: v1.1.2
Build: bab0fbab0c1a7c3641bd379f27857113d574d904
Repository: GitHub - kubernetes/ingress-nginx: Ingress NGINX Controller for Kubernetes
nginx version: nginx/1.19.9


W1124 14:48:02.150422 55 client_config.go:615] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
I1124 14:48:02.150534 55 main.go:223] “Creating API client” host=“https://10.96.0.1:443
I1124 14:48:02.156643 55 main.go:267] “Running in Kubernetes cluster” major=“1” minor=“29” git=“v1.29.0” state=“clean” commit=“3f7a50f38688eb332e2a1b013678c6435d539ae6” platform=“linux/amd64”
I1124 14:48:02.160361 55 main.go:86] “Valid default backend” service=“green-space/default-backend-service”
I1124 14:48:02.326960 55 main.go:104] “SSL fake certificate created” file=“/etc/ingress-controller/ssl/default-fake-certificate.pem”
I1124 14:48:02.343646 55 ssl.go:531] “loading tls certificate” path=“/usr/local/certificates/cert” key=“/usr/local/certificates/key”
I1124 14:48:02.353507 55 nginx.go:255] “Starting NGINX Ingress controller”
I1124 14:48:02.357611 55 event.go:282] Event(v1.ObjectReference{Kind:“ConfigMap”, Namespace:“ingress-nginx”, Name:“ingress-nginx-controller”, UID:“80dce088-13f3-49a5-bf60-f6730d681eca”, APIVersion:“v1”, ResourceVersion:“2710”, FieldPath:“”}): type: ‘Normal’ reason: ‘CREATE’ ConfigMap ingress-nginx/ingress-nginx-controller
I1124 14:48:03.456369 55 store.go:427] “Found valid IngressClass” ingress=“green-space/ingress-resource-uxz” ingressclass=“nginx”
I1124 14:48:03.456548 55 event.go:282] Event(v1.ObjectReference{Kind:“Ingress”, Namespace:“green-space”, Name:“ingress-resource-uxz”, UID:“3e826d55-93db-46d6-a33e-a646b024f654”, APIVersion:“networking.k8s.io/v1”, ResourceVersion:“2689”, FieldPath:“”}): type: ‘Normal’ reason: ‘Sync’ Scheduled for sync
I1124 14:48:03.554396 55 nginx.go:298] “Starting NGINX process”
I1124 14:48:03.554456 55 leaderelection.go:248] attempting to acquire leader lease ingress-nginx/ingress-controller-leader…
I1124 14:48:03.554877 55 nginx.go:318] “Starting validation webhook” address=“:8443” certPath=“/usr/local/certificates/cert” keyPath=“/usr/local/certificates/key”
I1124 14:48:03.555061 55 controller.go:159] “Configuration changes detected, backend reload required”
I1124 14:48:03.584990 55 leaderelection.go:258] successfully acquired lease ingress-nginx/ingress-controller-leader
I1124 14:48:03.585035 55 status.go:84] “New leader elected” identity=“ingress-nginx-controller-7d8559d595-ctcrl”
I1124 14:48:03.589805 55 status.go:299] “updating Ingress status” namespace=“green-space” ingress=“ingress-resource-uxz” currentValue=[] newValue=[{IP:10.109.107.58 Hostname: Ports:[]}]
I1124 14:48:03.594320 55 event.go:282] Event(v1.ObjectReference{Kind:“Ingress”, Namespace:“green-space”, Name:“ingress-resource-uxz”, UID:“3e826d55-93db-46d6-a33e-a646b024f654”, APIVersion:“networking.k8s.io/v1”, ResourceVersion:“3565”, FieldPath:“”}): type: ‘Normal’ reason: ‘Sync’ Scheduled for sync
I1124 14:48:03.632221 55 controller.go:176] “Backend successfully reloaded”
I1124 14:48:03.632287 55 controller.go:187] “Initial sync, sleeping for 1 second”
I1124 14:48:03.632341 55 event.go:282] Event(v1.ObjectReference{Kind:“Pod”, Namespace:“ingress-nginx”, Name:“ingress-nginx-controller-7d8559d595-ctcrl”, UID:“309f8bc3-e0be-4b35-b994-88e8bd3b242d”, APIVersion:“v1”, ResourceVersion:“3554”, FieldPath:“”}): type: ‘Normal’ reason: ‘RELOAD’ NGINX reload triggered due to a change in configuration

If you could shed a light here, since i don’t get your point.

Ok, I don’t know why, now it’s starting giving me green light…whatever…

Not sure either. Your fix is correct, and when I did the equivalent, the grader liked it. The most likely explanation for that is that there was some other issue with your fix.

or maybe the platform?

At the moment i can’t access any lab… for example, probably a restarting backend machines.

It could be interesting if you’d tried an attempt from the beginning, maybe you could have findout same lab scenario I’ve faced in terms of configs.

I actually did do the lab yesterday after I commented; short version – it did work for me. Not sure how you did the edits; I used kubectl edit deploy for updating the IC, and kubectl edit ingress for altering the ingress. I checked to make sure the IC actually restarted (it did). And then, the grader accepted what I did. So I’m not sure what you did that did not; I just know that you can run the lab successfully.