MetalLB: route TCP or UDP traffic (layer 4).
Ingress: is based on the HTTP or HTTPS (layer 7), using NGINX or HAProxy.
Once MetalLB is installed, the metallb-operator-controller-manager deployment starts a pod named operator.
As soon as the MetalLB operator starts, an interface of metalLB starts a controller deployment and a speaker daemon.
The speaker daemon ensure all/some nodes run a copy of pod.
The controller deployment:
1. Manages the number of the pods;
2. Manage how many nodes those pods should run;
3. Allocate an IP address to the load balancer from an address.
1. Service: add to the cluster;
2. MetalLB: assign an extrernal IP to the service;
3. MetalLB opertator:
3.1 start a speaker daemon,
3.2 start a controller deployment;
4. The speaker daemon started from 3.1, set runs a pod on each node;
5. The speaker pod on one of the nodes, housing the service pod, use ARP to announce the external IP;
6. Client traffic rout to the external IP to the node;
7. Service proxy: kube-proxy send traffic to all the pods of the service.
Deploy: update, rollback----------------------------------
| |
| RS (replica set): Replica count, self-healing, old versions----|
| | |
| | Pods: labels, annotations, co-scheduling -------------|
| | | |
Apps: |
---|
Pods run on nodes, thinking pods as apps and nodes as infrastructure.
Pod is the unit of scaling in the k8s. [scale up: add pods; scale down: remove pods]
We can't rely on the pod IPs, the YAML manifest file define the stable DNS name and the stable IP;
Pod is a wrapper that share the execution environment, resources, network namespace;
In the same pod, Pod is a wrapper which share the execution environment, resources, network namespace;
In the same pod, each container has its own unique port, share the same IP owned by the pod., share the same IP owned by the pod.