Kubernetes: Services and Ingress
Why a pod has no stable address, the Service and its three types, selector and endpoints, port and targetPort, a Service's DNS name and the Ingress that routes HTTP traffic by host and path.
- 30 cards
- 6 topics
- Free
The outline, topic by topic
Each topic is weighted the way the exam weighs it.
- Concepts
- Questions
- Sort and link
- On the diagram
- Scenarios
- Understand
A few cards from the deck
Service: what is it?
Show the answer
An object that gives a group of pods a stable address and DNS name, and spreads traffic across those its selector retains.
Pods are born and die with new addresses; the Service stays, and clients always aim at the same name.
A client pod calls
http://web. On which container port does the traffic arrive?
```yaml
apiVersion: v1
kind: Service
metadata:
name: web
spec:
selector:
app: web
ports:
- port: 80
targetPort: 8080`80808030080443
Show the answer
8080The URL without a port aims at the Service's
port, 80. The Service then redirects to the pods'targetPort: 8080. There is nonodePorthere, so nothing on 30080.A Service named
dbin the namespacedatahas the full DNS name …; a pod in the same namespace reaches it simply asdb.Show the answer
A Service named
dbin the namespacedatahas the full DNS name db.data.svc.cluster.local; a pod in the same namespace reaches it simply asdb.The cluster DNS completes the name with the calling pod's namespace; from another namespace, write
db.data.Endpoints: what is it?
Show the answer
The list of addresses of the ready pods a Service selects; it is kept up to date automatically.
If this list is empty (
<none>), the Service has nobody to send traffic to: wrong selector, or no ready pod.