exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 14 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 14
Topic #: 1
[All Professional Cloud Developer Questions]

You are developing a JPEG image-resizing API hosted on Google Kubernetes Engine (GKE). Callers of the service will exist within the same GKE cluster. You want clients to be able to get the IP address of the service.
What should you do?

  • A. Define a GKE Service. Clients should use the name of the A record in Cloud DNS to find the service's cluster IP address.
  • B. Define a GKE Service. Clients should use the service name in the URL to connect to the service.
  • C. Define a GKE Endpoint. Clients should get the endpoint name from the appropriate environment variable in the client container.
  • D. Define a GKE Endpoint. Clients should get the endpoint name from Cloud DNS.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
accuracy23
Highly Voted 3 years, 5 months ago
It's B - Clients are in the cluster and therefore can use service dns names. https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/ "Every Service defined in the cluster (including the DNS server itself) is assigned a DNS name. By default, a client Pod's DNS search list includes the Pod's own namespace and the cluster's default domain."
upvoted 19 times
...
santoshchauhan
Most Recent 7 months, 3 weeks ago
Selected Answer: B
B. This is the standard Kubernetes service discovery mechanism. When you define a Service in Kubernetes, it creates a DNS entry in the internal cluster DNS. Any pod in the cluster can then reach the service using the service name as a DNS name (e.g., http://service-name). This is the most straightforward and Kubernetes-native way to enable service discovery within a cluster.
upvoted 1 times
...
Raja2112
1 year ago
This is an example of Microservice Architecture, so Ans is : B
upvoted 1 times
...
__rajan__
1 year, 1 month ago
Selected Answer: B
B is correct.
upvoted 1 times
...
maxdanny
1 year, 2 months ago
Selected Answer: B
https://www.exam-answer.com/gke-service-url-image-resizing-api
upvoted 1 times
...
zanhsieh
1 year, 4 months ago
Selected Answer: A
A. GKE endpoint is external facing, Opt C and D are out. Also exposing to endpoint won't expose all containers in the GKE cluster - if one service exposes to 4000 nodes with containers then does this mean the GKE would need to update 4000 times? This just doesn't make sense. Opt B use service name, in other words, CNAME, so it still has to go through Cloud DNS. Hence the opt A shall be correct.
upvoted 1 times
...
gc_exam2022
1 year, 5 months ago
Selected Answer: C
It's B
upvoted 1 times
...
closer89
1 year, 5 months ago
Selected Answer: B
both A and B are valid Option A, DNS A record maps service FQDN to IP address, fqdn like service-name.default.svc.cluster.local B is more easier, just use http://service-name
upvoted 1 times
...
telp
1 year, 9 months ago
Selected Answer: B
answer is B because client are in the same cluster so service name can be used.
upvoted 1 times
...
Mark123321
1 year, 10 months ago
Selected Answer: C
Question reads "IP address" and I don't think that using B the IP can be obtained.
upvoted 1 times
Mark123321
1 year, 10 months ago
C answer is suggesting to define endpoint in the service and others can use that endpoint (reading its name from a variable) to ask the service what IP it has, that why I think C is correct.
upvoted 1 times
...
...
ajipeggy
1 year, 11 months ago
Selected Answer: B
https://cloud.google.com/kubernetes-engine/docs/concepts/service-discovery "In Kubernetes, service discovery is implemented with automatically generated service names that map to the Service's IP address. Service names follow a standard specification: as follows: my-svc.my-namespace.svc.cluster-domain.example. Pods can also access external services through their names, such as example.com. "
upvoted 3 times
...
tomato123
2 years, 2 months ago
Selected Answer: B
B is correct
upvoted 3 times
...
kinoko1330
2 years, 2 months ago
Selected Answer: B
B is correct
upvoted 1 times
alex8081
2 years, 2 months ago
But qn states: "..to get the IP address of the service". Or not?
upvoted 1 times
...
...
jdx000
2 years, 3 months ago
Selected Answer: B
Should be B
upvoted 1 times
...
nazonazonazo
2 years, 8 months ago
B is collect. If client and server are in same namespace, C is collect.But in this case, no condition of namespace. So client pod must be use server service name.
upvoted 1 times
...
zaxxon
2 years, 9 months ago
D: see https://cloud.google.com/endpoints/docs/openapi/get-started-kubernetes-engine#configuring-endpoints-dns
upvoted 1 times
...
ralf_cc
3 years, 4 months ago
A - use SVC to expose your pod, and get the cluster DNS service to get the IP
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago