large Outline

* Kubernetes Pod Detailed explanation
* Kubernetes Introduction to workload and services
Kubernetes Pod Detailed explanation

Kubernets overview
Kubernets overview
Kubernetes Key concepts -Pod
Kubernetes Key concepts -Pod
* stay Kubernetes in , pods Is able to create , dispatch , And management of the minimum deployment unit , Is a collection of containers , Instead of a separate application container
* The same Pod Containers in share the same network namespace , IP Address and port space .
* In terms of life cycle , Pod It's short-term, not long-term . Pods Is scheduled to the node , Remain on this node until it is destroyed .
Pod Detailed explanation - container
Pod Detailed explanation - container
Infrastructure Container: Basic container

* User not visible , No need to feel
* Maintain the whole Pod Cyberspace
InitContainers: Initialize container , It is generally used for service waiting and registration Pod Information, etc

* Execute before business container
* Sequential execution , Exit successfully ( exit 0), Start the business container after successful execution
Containers: Business container

*   Parallel start , After successful startup Running
Basic composition of container
Basic composition of container
Pod Detailed explanation - health examination
Pod Detailed explanation - health examination
Pod Detailed explanation - External input
Pod Detailed explanation - External input
configuration file ( ConfigMap) And key ( Secret) introduce

Pod Detailed explanation - Persistent storage

PV/PVC introduce

Pod Detailed explanation - Service domain name discovery

dnsPolicy: Pod The strategy of domain name resolution in

* ClusterFirst: use kube-dns As domain name resolution server
* Default: Using nodes ( kubelet) The specified domain name server resolves the domain name
* ClusterFirstWithHostNet: When Pod Use when using host network deployment
Kubernetes Introduction to workload and services

Pod Relationship to workload

Critical workload -ReplicaSet

* ReplicaSet For resolution pod The problem of capacity expansion and reduction .
* Usually used for stateless applications
Critical workload -Deployment
Critical workload -Deployment
Kubernetes Deployment Official updates are provided Pod and Replica
Set( Next generation ReplicationController) Methods , You can use the Deployment Object only describes the desired state ( Expected operating state ),Deployment The controller converts the current actual state to the desired state for you ;

Deployment Integrated online deployment , Rolling upgrade , Create a replica , Suspend online task , Resume online task , Roll back to a previous version ( success / stable )Deployment Etc , To a certain extent ,
Deployment Can help us achieve unattended online , Greatly reduce the complexity of our online process communication , Operational risk .

Deployment Typical use cases for :

* use Deployment To start ( go online / deploy ) One Pod perhaps ReplicaSet
* Check one Deployment Is the execution successful
* to update Deployment To recreate the corresponding Pods( for example , A new one is needed Image)
* If existing Deployment instable , So roll back to an early stable Deployment edition
Critical workload -StatefulSet
Critical workload -StatefulSet
StatefulSet— Stateful application
It is used to solve various problems pod Instance independent lifecycle management , Provides the starting order and uniqueness of each instance

* stable , Unique network identifier .
* stable , Persistent storage --StatefulSet: each pod Corresponding to one pv
* Orderly , Elegant deployment and expansion .
* Order , Graceful deletion and termination .
* Ordered auto scrolling updates .
Critical workload -DaemonSet
Critical workload -DaemonSet
DaemonSet Can make all ( Or something specific ) Of Node Nodes run the same pod. When a node joins the kubernetes collection \ In a group , pod Will be (
DaemonSet) It is scheduled to run on this node , When node from kubernetes Removed from cluster , cover (
DaemonSet) Scheduled pod Will be removed , If deleted DaemonSet, All with this DaemonSet dependent pods Will be deleted .

in use kubernetes To run the application , A lot of times we need to be in one area ( zone) Or all Node Run the same daemons on ( pod), For example, the following scenario :

* each Node Runs a distributed storage daemons on , for example glusterd, ceph
* Run the log collector at each Node upper , for example fluentd, logstash
* The collection end of operation monitoring is in each Node, for example prometheus node exporter, collectd etc.
Critical workload -Job
Critical workload -Job
Kubernetes Key concepts -CustomResourceDefinition

 Pod Relationship with services

 Service

*  Service Defined pods And the policy for accessing this set . Pods Set is defined by Service Provided by Label Selector completed
* Service The introduction of the pod Is transparent to the client , The client only needs to know service Address of , from service To provide an agent
* Service The abstraction makes the front-end client and the back-end Pods To decouple
* support ClusterIP, NodePort as well as LoadBalancer Three types
* Service The underlying implementation of userspace, iptables and ipvs Three modes
Service type : ClusterIP, NodePort, LoadBalancer
Service type : ClusterIP, NodePort, LoadBalancer
 Ingress

*  Ingress be based on service realization 7 Layer routing and forwarding capability

Technology