Cloud and Container Basics

In a Kubernetes cluster, HTTPS requests arriving for one host name should be routed to the api Service if the path begins with /api, and to the web Service otherwise. Which of the following resources is suitable for defining this routing rule?

  1. AIngress
  2. BReplicaSet
  3. CA Service of type: ClusterIP
Show answer and explanation

Answer: A. Ingress

An Ingress is a resource that defines rules for routing HTTP and HTTPS requests from outside the cluster to Services according to the host name and URL path, and TLS termination can also be configured there. The component that actually receives and routes the requests is an Ingress controller installed in the cluster (which acts as a reverse proxy). A Service of type: ClusterIP is an endpoint reachable only from inside the cluster and has no path-based routing. A ReplicaSet keeps the number of Pods and has nothing to do with routing traffic.

  • A. Correct. It routes requests to Services by host name and path.
  • B. A ReplicaSet keeps the specified number of Pods running.
  • C. A ClusterIP Service is an endpoint inside the cluster and does not route by URL path.
Practice this topic Back to topic

Books on Cloud and Container Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Cloud and Container Basics questions

  1. A database password is stored in a Kubernetes Secret. Which of the following correctly describes a Secret?
  2. A web application cannot handle requests for about 60 seconds after starting, while it loads its cache, and returns 503 from /ready during that time. Which of the following correctly describes the effect of adding the settings above to the Pod's container?
  3. In a web application on Kubernetes, the check performed by the liveness probe was made to include whether the application can connect to the database it depends on. Which of the following is the most likely problem with this setting?
  4. A Kubernetes HorizontalPodAutoscaler has a target CPU utilization of 70% and a range of 1 to 10 Pods. Currently the average CPU utilization of 5 Pods is 30%. When the required number of Pods is computed as ⌈current number × current utilization ÷ target utilization⌉ (⌈ ⌉ means rounding up), which of the following is the required number of Pods?
  5. In a Deployment whose Pod containers have the settings above, four Pods are running, each using 400m (0.4 cores) of CPU. The HorizontalPodAutoscaler's target CPU utilization is 60%, and the required number of Pods is computed as ⌈current number × current utilization ÷ target utilization⌉. Which of the following is the required number of Pods?