nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #211

You are developing an application using different microservices that must remain internal to the cluster. You want the ability to configure each microservice with a specific number of replicas. You al

The correct answer is A. Deploy each microservice as a Deployment. Expose the Deployment in the cluster using a. A Kubernetes Deployment is the correct resource for managing a set of identical, replicated pods - the 'replicas' field directly controls how many instances run. Exposing the Deployment with a ClusterIP Service gives every microservice a stable internal DNS name and virtual IP th

Deploying applications

Question

You are developing an application using different microservices that must remain internal to the cluster. You want the ability to configure each microservice with a specific number of replicas. You also want the ability to address a specific microservice from any other microservice in a uniform way, regardless of the number of replicas the microservice scales to. You plan to implement this solution on Google Kubernetes Engine. What should you do?

Options

  • ADeploy each microservice as a Deployment. Expose the Deployment in the cluster using a
  • BDeploy each microservice as a Deployment. Expose the Deployment in the cluster using an
  • CDeploy each microservice as a Pod. Expose the Pod in the cluster using a Service, and use the
  • DDeploy each microservice as a Pod. Expose the Pod in the cluster using an Ingress, and use the

How the community answered

(39 responses)
  • A
    90% (35)
  • B
    3% (1)
  • C
    5% (2)
  • D
    3% (1)

Explanation

A Kubernetes Deployment is the correct resource for managing a set of identical, replicated pods - the 'replicas' field directly controls how many instances run. Exposing the Deployment with a ClusterIP Service gives every microservice a stable internal DNS name and virtual IP that load-balances across all current pod replicas, regardless of how many are running. This uniform address never changes even as the Deployment scales up or down. Option B is wrong because an Ingress routes external HTTP traffic into the cluster - it is not designed for internal inter-service communication. Options C and D deploy bare Pods, which lack the self-healing and replica management capabilities of Deployments.

Topics

#Kubernetes Deployments#Kubernetes Services#Microservices#GKE

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice