Hello K8s
- Create the cluster
kind create cluster
kubectl apply -f mysql-deploy.yaml
k create -f mysql-svc.yaml
k get svc mysql
Get CLUSTER – IPk apply -f myweb-deploy.yaml
Connect the CLUSTER – IPk create -f myweb-svc.yaml
Specify nodePortk get nodes -o wide
Obtain the INTERNAL IP address (nodeIP for short) of nodecurl -vL http://<nodeIP>:<nodePort>/demo/
Other commands
k get pods
k get nodes
k get scv
k describe node <name>
Copy the code
Cluster Cluster
A Cluster contains one Master and N nodes (N>=0).
Key processes on the Master
- Kube-apiserver: a service that provides HTTP RESTful apis. It is the only portal for adding, deleting, modifying, and querying all resources in Kubernetes. It is also the portal process for cluster control.
- Kube-controller-manager: automatic control center for all resource objects in Kubernetes
- Kube-scheduler: The process responsible for resource scheduling (Pod scheduling)
- etcd
Key processes on Node
- Kubelet: responsible for Pod container creation, start and stop tasks, and work closely with Master to achieve the basic functions of cluster management.
- Kube-proxy: Service that implements the communication and load balancing mechanism of Kubernetes Service.
- Container runtime (such as Docker) : Responsible for native container creation and management.
Service
Generally speaking, a Service refers to a stateless Service, usually provided by multiple copies of the program, or in special cases, stateful single-instance services, such as MySQL data storage services.
The system is ultimately composed of a number of independent microservice units that provide different service capabilities. The services communicate with each other through TCP/IP, thus forming a strong and flexible elastic grid.
Pod
To be continued…