Hello K8s

  1. Create the clusterkind create cluster
  2. kubectl apply -f mysql-deploy.yaml
  3. k create -f mysql-svc.yaml
  4. k get svc mysqlGet CLUSTER – IP
  5. k apply -f myweb-deploy.yamlConnect the CLUSTER – IP
  6. k create -f myweb-svc.yamlSpecify nodePort
  7. k get nodes -o wideObtain the INTERNAL IP address (nodeIP for short) of node
  8. curl -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…