Services
Each Service type wraps the one before it
ClusterIP inside the cluster, NodePort on every node, LoadBalancer from the cloud.
Pods are replaced all the time, and each new pod has a new address. A Service fixes that. The basic type is cluster I P: one stable address inside the cluster, in front of whichever pods match. Node port wraps it. The same port is opened on every node, and forwards to the cluster I P. Load balancer wraps that. The cloud provides a load balancer with a public address, which forwards to the node port. So a client on the internet reaches the pods.
Services · Going deeper
Service types, selectors and DNS
ClusterIP, NodePort, LoadBalancer, ExternalName and headless.
Ingress
One entry point routes HTTP by host and path
An Ingress is rules. An Ingress controller carries them out. Gateway API is the successor.
A load balancer for every service is expensive. For web traffic there is a better way. All requests arrive at one entry point: an ingress controller. It reads rules. Requests for the root of the site go to the web service. Requests for slash A P I go to the A P I service. The rules are written in an Ingress object. And remember: the object does nothing by itself. A controller must be installed to act on it.
Ingress · Going deeper
Gateway API
GatewayClass, Gateway and HTTPRoute: three objects for three roles.
Check yourself
Which Service type does the drawing show?
Network policy
Every pod can reach every pod, until a policy says otherwise
The default is allow all. A NetworkPolicy selects pods and lists what may reach them.
Now security on the network. With no policy, every pod can reach every other pod. Here the web pod can talk straight to the database, skipping the A P I. A network policy closes that. This one selects the database pods and allows traffic only from the A P I pods. Web is now refused. One warning for the exam. The policy is only a rule. The network plugin enforces it, and not every plugin does.
Network policy · Going deeper
The pod network, CNI plugins and meshes
CNI plugins such as Calico and Cilium build the pod network.
Storage
A pod claims storage. It never names a disk
Pod to PersistentVolumeClaim, to StorageClass, to a PersistentVolume made on demand.
Storage follows the same pattern of asking, not naming. A pod needs somewhere to keep data. It mounts a persistent volume claim. The claim says how much, and what kind of access: ten gigabytes, read write once. The claim names a storage class, which says how such storage is made, through a C S I driver. Kubernetes then creates a persistent volume: a real disk. The developer wrote the first two, the administrator set up the class, and Kubernetes did the rest. Delete the pod, and the claim and the disk remain.
Storage · Going deeper
Access modes and kinds of volume
ReadWriteOnce, ReadWriteMany, and ephemeral against persistent.
Check yourself
What did the pod refer to at the "?"
Interfaces
Three plugs: CRI, CNI and CSI
CRI for runtimes, CNI for networking, CSI for storage.
Step back, and one design explains both halves of this lesson. Kubernetes itself does very little of the low-level work. To run containers it calls a runtime through C R I: container D, or cry O. To connect pods it calls a network plugin through C N I: Calico, Cilium or Flannel. To make and attach disks it calls a storage driver through C S I. Three standard plugs. That is why the same manifests work on any cloud.
Interfaces · Going deeper · 1 of 2
What a service mesh adds
A mesh adds mutual TLS, traffic control and metrics through sidecar proxies.
Interfaces · Going deeper · 2 of 2
Clue words for networking and storage
Service types, Ingress, NetworkPolicy, and the claim chain.
Check yourself
A team lists what it needs as shown. What should it add?
Lesson complete
You finished “Networking and storage”
Answer the questions along the way to see your score here.