Kubernetes 学习整理 (二)

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.

As nodes are added to the cluster, pods are added t o them. As nodes are removed from the cluster, those pods are removed.

The controller deployment:
1. Manages the number of the pods;
2. Manage how many nodes those pods should run;
3. when a service of type LoadBalancer is added, k8s uses the controller to allocate an IP address to the load balancer from an address pool.

a service of type LoadBalancer micro-serviceis is an abstraction which defines a logical set of Pods and a policy by which to access them.
The set of pods targeted by a service is usually determined by a selector.

When we say "allocate an IP address to the load balancer", it means that an IP address is allocated to the external load balancer that is associated with
the Service of type LoadBalancer.

The client use the allocated IP address to send requests to the load balancer, the load balancer uses the same IP address to distribute the incoming requests
to the appropriate Pods via the Service.

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.

posted @ 2024-01-21 19:52  vivi~  阅读(2)  评论(0编辑  收藏  举报