Kubernets Overview Flashcards
Kubernetes Cluster Services
In charge of matching the observed state to the desired state.
Kubelet
A process attached to each worker node that manages it’s respective node and makes it possible for the cluster and nodes to communicate with each other. They ‘listen’ for instructions from the kube API server and deploys or destroys containers on the nodes as required. If nodes are cargo ships then the kubelet is the captain.
Worker nodes
Responsible for holding pods and containers. In the worker nodes is where applications run.
Master Node
Holds an API Server, Controller Manager, Scheduler, and etcd.
Kube API Server
Located within the master node. It is the entry point to the kubernetes cluster. Responsible for orchestrating all operations within the cluster. It is the communications point between kubernetes clients (ie. ai, api, or cli) “talk” and the cluster.
Controller Manger
Located in the master node. Keeps an overview of what’s happening in the cluster, for example if something needs to be repaired or if a container died and needs to be restarted. Monitors the node controller and replication controller.
Scheduler
Located in the master node. Responsible for deciding which worker node the next container should be scheduled based on workload and the available server resources on each worker node.
etcd
A key value storage located in the master node. Persistence for the control plane.
Constantly keeps track of the current state of the kubernetes cluster. Contains all configuration data and status data of each worker node, as well as each container within each worker node. Creates ‘snapshots’ that can be used as backup and restore data in case a node or container malfunctions.
Virtual Network
Enables the master and worker nodes to talk to eachother. It spans all the nodes that are a part of the cluster and turns them all into one powerful machine that has the sum of all the resources of individual nodes.
Pod
It is an abstraction layer that wraps around a container, as well as the smallest unit in kubernetes that users will configure and interact with. Each pod has its own IP address, making pods their own self-containing servers. A pod usually contains one container and a container usually contains only one application. Separate apps, separate pods.
What does pods being ephemeral mean?
When a pod is down or dies, a brand new one is recreated with its configurations but with a new IP address.
Services
Each pod has a “service” in front of it which allows pods to communicate in case one is down or dies. This way, when a new pod is created with a new IP address, the pods can still communicate to each other. A pod’s service will have a permanent IP address and is a load balancer.
Kubernetes configuration
Specified in a YAML or JSON file and passed from the kubernetes client (ui, api, or cli) to the API server of the master node.
Deployment file
A template used for creating pods, typed in yaml format. It declares the desired state of the kubernets cluster.
What can you configure in a deployment file?
1) How many pod replicas should be made
2) What app will be inside a pod’s container
3) Env variables and port configuration of the containers