# Kubernetes
---
### Background
Kubernetes (also known as K8s) is an **open-source container orchestration system** that **automates the deployment, scaling, and management** of containerized applications. It was originally developed by Google, and is now maintained by the Cloud Native Computing Foundation (CNCF).
Kubernetes **provides** a platform to deploy and manage containerized applications across a **cluster of nodes**. A node is a physical or virtual machine that runs one or more containers. Containers are a lightweight and portable way to package software applications along with their dependencies.
Kubernetes **uses a declarative approach** to describe the desired state of the application and the infrastructure on which it runs. The Kubernetes control plane then automatically manages the deployment and scaling of the application to ensure that the actual state matches the desired state.
---
### Key Components
Kubernetes has several key components:
- **Master Node**: The Master Node is the brain of Kubernetes, which manages and controls the overall cluster. It manages the cluster state, schedules applications, and provides the API endpoint for interacting with the cluster.
- **Worker Node**: Runs the containerized applications and services. It communicates with the Master Node to receive instructions and perform tasks such as running and managing containers.
- **etcd**: Distributed key-value store that Kubernetes uses to store the cluster's configuration data. It provides a reliable and highly available way to store and manage the cluster state.
- **kubelet**: An agent that runs on each Worker Node and communicates with the Master Node. It is responsible for managing the containers on the node, including starting and stopping containers and reporting their status to the Master Node.
- **kube-proxy**: Network proxy that runs on each Worker Node. It handles network routing for the containers running on the node and provides load balancing and service discovery functionality.
- **API server**: Provides a RESTful API for interacting with the Kubernetes cluster. It exposes the Kubernetes API to the outside world and provides an interface for managing the cluster state.
- **Controller manager**: Responsible for managing the various controllers that watch the state of the cluster and perform actions in response to changes.
- **Scheduler**: Responsible for scheduling applications and services to run on the Worker Nodes based on resource availability and other constraints.