Difficulty in understanding ingress, service and deployment relation/connection

I was curious as to where I can better understand the connection between ingress, services and deployments, like how these three work in sync to run an app on a particular targetport i.e NodePort.
Could you direct me to the particular lesson and lab for practice?

If you’re taking our CKA course, there are two ingress labs: one that concentrates on the ingress resource, and one that builds up a copy of the Nginx ingress controller (ingress-nginx) and shows you how it is set up.

The way you set up an app that you put behind an ingress resource works something like this:

  1. You create a deployment for something you want to serve up.
  2. You expose the deployment as a service. A simple ClusterIP works fine; you don’t need a NodePort service or a LoadBalancer service.
  3. You create an ingress resource in the same namespace that exposes the service or services at the path (and optionally the host, where the host points at the Ingress Controller’s load balancer).

Ingress Nginx works as a layer 7 load balancer – it knows about HTTP as protocol, and can read HTTP headers. The Ingress Controller (IC) ferries the data from the IC’s pods over to the targeted services you defined in the ingress resource. It also allows you to use a TLS certificate for the exposed set of services, although this is a topic for the CKS exam.

1 Like