Deploy Nginx Web Server on Kubernetes Cluster

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.

1 Like

Thank you @Inderpreet

@Inderpreet @kodekloud-support3 and @Ayman
Hello,

My Task failed with:

image

I think i got everything right:


Maybe the way you define label for deployment cause the validation script to fail.

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.

@Inderpreet @kodekloud-support3 and @Ayman

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.

@Inderpreet Kindly check this. I am not sure what I missed…

2020-09-15 19_01_51-KodeKloud - Engineer and 6 more pages - Ram - Microsoft​ Edge

2020-09-15 18_59_41-KodeKloud - Engineer and 5 more pages - Ram - Microsoft​ Edge

2020-09-15 18_58_34-KodeKloud - Engineer and 5 more pages - Ram - Microsoft​ Edge

hi @rahul456 @Inderpreet @player001…could you please check and update on the above post?

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.

@ramnamy, sorry for the issue, this is marked pending for you, please give it an another try

@rahul456 Thanks, I completed the task. Will I receive a new task for today? or I have to wait for one more day?

@ramnamy, you should have new task in your bucket now.

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)