Deploy Voting App on Kubernetes clarification

Hi @Ayman @Inderpreet

I have created all the deployment and service as per the description you can see the review here,

But i believe its a description error.
Question says says Create a service db under the same namespace. Port should be 5432, targetPort should be 5432 and its type should be ClusterIP

Without any selector attaching to the service, its a waste to create. I assumed db service is for db-deployment and i have exposed it. Now the error says service endpoint exposes deployment ‘db-deployment’.

Why do we need db service without any selector? Does that even make any sense of creating it?

@Ayman @Inderpreet,

People have voted for description error for this. Can you please look into this task ASAP. I may miss my today’s task because this task is still pending state.

Hi @sathish2032,

I have reviewed your task and found issue in your manifest. Its not a description error, its your error where you failed to use correct labels in manifest. Labels are always important as this will associate the pods to the correct service. Thus in your deployment, that is incorrect. Always test your service association with the correct endpoints using the command kubectl get ep svc-name

Please correct it and try again.

Hi @kleansoul,

I understood the problem. However in the question it says Create a service db under the same namespace. Port shold be 5432 , targetPort should be 5432 and its type should be ClusterIP .
Now the question is this service doesnt expose any deployment. That means if i create the service also it doesnt have any endpoint. So whats the point?

Hi @sathish2032,

There are two points here:

  1. you failed to put proper labels on any of the deployments therefore the service selectors took incorrect endpoints.

  2. To clarify your question against the task description point 7, this is clearly a db service which is understood to be used to expose the db-deployment (postgres). This is kinda obvious as there is no other db in any deployment under task description. This db service will be used by other application to connect to backend using db dns to connect to the pod.

Hope it explains your question further.

I understand what you are saying. But my point is everywhere else it is clearly highlighted like in redis it says ClusterIP service endpoint exposes deployment redis-deployment under namespace vote . Like wise for other services. Except DB. It doesnt say expose the DB deployment. That is confusing. I have assumed it and finish the task. But it is misleading description.

@sathish2032

So basically, it is safe to assume that all the services should have exposed endpoints and selectors pointing to their corresponding deployments? Do you mind sharing what you did different from the failed task?

Many thanks

Again @sathish2032 I repeat, your issue is not in one point but as in whole. You did not configured labels correctly in any of the deployment. Let alone the db-deployment. If you would have understood that clearly then I don’t think it would have been difficult for you to understand and figure out this db service label too.