Introduction to Kubernetes Flashcards
Kubernetes helps you manage applications that are made up of
hundreds or maybe thousands of containers.
Kubernetes helps you manage applications that are in different environments like
physical machines, virtual machines, cloud environments or even hybrid deployment environments.
How the need for an orchestration tool evolved:
★ Trend from Monolith to microservices
★ Increased usage of containers
★ Managing those hundreds or thousands of containers
Features of container orchestration tools
- High availability
- Scalability
- Disaster Recovery
The cluster must have at least one :
Master Node.
Connected to the Master Node you have a couple of
Worker Nodes, where each Node has a Kubelet process running on it.
A Kubelet is a Kubernetes process that makes it possible for
all cluster nodes to communicate with each other and execute tasks on Worker Nodes, like starting a web application container or database containers.
The Master Node runs several Kubernetes processes that are absolutely necessary to manage the cluster properly. These processes are:
● API server
● Controller Manager
● Scheduler
API server, which also is a container. An API server is the
entry point to the Kubernetes cluster It is the process, which the different Kubernetes clients will talk to.
Kubernetes clients are:
● UI - when using Kubernetes dashboard
● API - when using scripts and automating technologies or
● CLI - Kubernetes command-line tool (kubectl)
Controller Manager keeps an overview of
what is happening in the cluster. Whether something needs to be repaired or maybe if a container died and it needs to be restarted.
Scheduler is responsible for scheduling containers on
different Nodes based on the workload and the available server resources on each Node.
etcd is a key value storage which holds at any time
the current state of the Kubernetes cluster
etcd stores all the ________ data and all the ____ data of each Node and each container inside of that Node.
configuration data ; status data
Using that etcd snapshot you can
recover the whole cluster state.
etcd snapshots allows Kubernetes to heal itself using
the backup and restore made of the current state of all components in your cluster.
the control plane is responsible for making decisions about the cluster and
pushing it toward the desired state.
Virtual Network enables the communication between
Worker Nodes and Master Nodes.
The Virtual network spans
all the Nodes that are part of the cluster.
a virtual network turns all the Nodes inside of the cluster into one
powerful machine that has the sum of all the resources of individual Nodes.
If for example you lose a Master Node access you will not be able to access
the cluster anymore
Have a backup of your master at all time is non-negotiable
Think of a Pod as a ________ over a container.
wrapper
On each Worker Node you can have multiple
Pods and inside of a Pod you can again have multiple containers. Even though its best practice to only have one application per Pod. Unless a dependency is required.
Pod is a component of Kubernetes that manages the containers running inside itself without our intervention. If a container
stops or dies inside of a Pod it will automatically be restarted inside the Pod.
Pods get assigned dynamic IP address by ddefualt but you wanted a persistent address
You would have to associate Services to that Pod to provide a persistent static IP address.
each application Pod gets its own Service sitting in
front of it, to handle
the communication with other
pods.
If a Pod behind the Service dies and gets recreated
the Service stays in place, because
its lifecycle is not tied to the lifecycle of the pod.
The Service has two main functionalities.
Providing a static IP address.
Load balancer functionality.
if you have 3 Pods of the same
application, you can use the
same service to handle communication with all 3 pods
How do we actually create those components, like Pods and Services in Kubernetes cluster?
Kubernetes clients, like Kubernetes dashboard, Kubernetes API or a command line tool kubectl, all talk to the API server. Using these clients you can send configuration requests to the
Deployment is essentially a Yaml file that acts as a
blueprint for creating Pods and that blueprint is defined in the template attribute under the specifications section
Configuration requests in Kubernetes are written in ____ ____
declarative form
A declarative syntax form means we
declare what our desired outcome is and Kubernetes tries to meet those requirements.