Topic 1 Question 14
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?
Define a GKE Service. Clients should use the name of the A record in Cloud DNS to find the service's cluster IP address.
Define a GKE Service. Clients should use the service name in the URL to connect to the service.
Define a GKE Endpoint. Clients should get the endpoint name from the appropriate environment variable in the client container.
Define a GKE Endpoint. Clients should get the endpoint name from Cloud DNS.
ユーザの投票
コメント(17)
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."
👍 18accuracy232021/06/02A - get the cluster IP of the SVC
👍 3Kzee2021/05/07these answers are a bit confusing to me. Service discovery is done in 3 ways: with env vars, with kubernetes DNS and with Istio. Env vars are not suggested because they are static and needs to be manually updated in case of new changes, Istio is an optional addon, kubernetes DNS is an addon that gke activates by default and is the suggested way for service discovery.
So I guess the answer includes using the DNS? I don't know
👍 3mastodilu2021/05/19
シャッフルモード