As per the question I believe the labels app
must have value app-nginx
. The mapping seems correct but the labels value is incorrect as per requirements mentioned that’s why it failed I believe.
@Inderpreet
The task asks for the label app with nginx-app value in deployment, I don’t think it says the pods must have the same label. I gave the label app: nginx-app and type: front-end to deployment but gave app: nginx to pods (as you can see the deployment selector use app: nginx also)
@francilio yes labels are for deployment only not for pods as per question. I got your point and marked it Success
for you.
@Inderpreet @kodekloud-support3 and @Ayman
Hello,
My Task failed with:
I think i got everything right:
Hello, @nenadmiladin
You defined label in pod template, services, but in the main case, you didn’t define label in the deployment which caused task got failed.
This is a screenshot of the copied code, it must have been wrongly copied. The application works, it’s not that
It is not mentioned that the deployment should specifically also have the label.
App labels should be app:
nginx-app
and type:
front-end
.
I have put everywhere where it was needed and the application works.
Okay, I just shared my view. Because you didn’t attach the task description. So just evaluating what is the cause of failure.
KKE team will verify it.
Hello, @ramnamy
If I am not wrong, You have to add label in the deployment metadata labels. Can you share the task image? It would be good to clear.
I am sorry I didn’t have task screenshot…
Thanks @Tej-Singh-Rana for your response.
But I am not sure why the label for deployment matter…
Deployments selects the pods from Pod’s Label
Service selects the pods from Pod’s Label
Is there any place deployment label is needed for this task?
I think i had the service and deployment up & running
Can this reassigned for me please?
rahul456 and inderpreet can reassign you this task. They will look into this if it’s possible.
I can’t assign you this task. If you have any issue with the task. You can write your thoughts in the “Improve this task” option which is available in the below the each tasks.
@rahul456 Thanks, I completed the task. Will I receive a new task for today? or I have to wait for one more day?
HI guys @rahul456 @Inderpreet, I have got a failed validation message, it say "NodePort is not correct’ while I have it specified on the nginx-service.yml file. Please check.
The validation.
My configs
Cheers,
Salim
Hi @Salim . It is not a validation error. The targetPort sets the port on pod (vide kubectl explain service.spec.ports.targetPort
). To set the nodePort you should’ve added an attribute nodePort
in ports item.
The result of kubectl get service
should be (note the PORT(S) column and compare it with your result)