Skip to content

Instantly share code, notes, and snippets.

@andreafspeziale
Last active January 19, 2022 15:11
Show Gist options
  • Save andreafspeziale/b85fb1db49dc854ff48870dc398382de to your computer and use it in GitHub Desktop.
Save andreafspeziale/b85fb1db49dc854ff48870dc398382de to your computer and use it in GitHub Desktop.
Some Kubernetes notes

Kubernetes

Basic Actors

| Your local machine | Kubernetes Master Node / Control Plane | Kubernets Nodes / Workers |
|--------------------|----------------------------------------|---------------------------|
| You CLI            | api-server                             | kublet                    |
|                    | etcd database                          |                           |
|                    | scheduler                              |                           |
|                    | controller-manager                     |                           |

Kubernetes workflow

  1. #localmachine CLI sends to the api-server a command like "k create deployment web --image nginx —replicas=3"
  2. #controlplain api-server asks to etcd db to save a new deployment object
  3. #controlplain api-server returns to CLI a “created” message. It means the specs about the deployment have been successfully stored in the etcd db rather than be actually created in the actual nodes.
  4. #controlplain controller-manager (through api-server) pulls info from etcd db and asks to etcd db to save the resource specified by the saved deployment object which is a replica-set.
  5. #controlplain controller-manager (through api-server) pulls info from etcd db and asks to etcd db to save the resource specified by the saved replica-set object which are some pods. The pods are saved in the etcd db with PENDING status
  6. #controlplain scheduler (through api-server) pulls info from etcd db finding some pods in PENDING status, so it runs some algos in order to understand where (node1, node2…) is better to create those pods and saves the info in the etcd db.
  7. #workers kublet (through api-server) checks if any new pods have been assigned to its node. It finds them and (through container runtime - docker) creates them. As soon as they are running kublet (through api-server) will update the pods status to RUNNING in the etcd db.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment