Kubernetes Fundamentals
Kubernetes (also known as K8s) is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It was developed by Google and is now maintained by the Cloud Native Computing Foundation (CNCF).
Kubernetes provides a framework for deploying and managing containerized applications at scale, by automating many of the tasks involved in managing container clusters. It allows developers to focus on writing code while providing a platform for running and scaling their applications.

Kubernetes uses a declarative model for managing application resources, which allows developers to describe their desired state, and Kubernetes takes care of the implementation details. It provides a variety of features and tools for managing containerized applications, including load balancing, scaling, rolling updates, self-healing, and more.
Kubernetes supports a wide range of container runtimes, including Docker, rkt, and CRI-O, and can be run on a variety of platforms, including on-premise, in the cloud, or in hybrid environments. It is widely used in production environments by organizations of all sizes, from startups to large enterprises.
Kubernetes Architecture
Kubernetes has a master-slave architecture, with a control plane that manages the state of the cluster and worker nodes that run the applications. The control plane consists of several components that work together to manage the cluster, including the API server, etcd, kube-scheduler, kube-controller-manager, and cloud-controller-manager.
API Server: The API server is the central component of the Kubernetes control plane. It exposes the Kubernetes API, which allows users to interact with the cluster and manage the resources deployed on it.
etcd: etcd is a distributed key-value store that is used to store the configuration data and the state of the Kubernetes cluster. The API server reads from and writes to etcd to maintain the desired state of the cluster.
Kube-Scheduler: The kube-scheduler is responsible for scheduling the pods (the smallest deployable units in Kubernetes) to run on the worker nodes. It takes into account factors such as resource requirements, node capacity, and other constraints.
Kube-Controller-Manager: The kube-controller-manager includes several controllers that monitor the state of the cluster and take action to maintain the desired state. For example, the node controller monitors the status of the worker nodes, while the replica set controller ensures that the desired number of replicas of a particular pod are running.
Cloud-Controller-Manager: The cloud-controller-manager is responsible for interacting with the cloud provider's APIs to manage resources such as load balancers, storage volumes, and virtual machines.

On the worker nodes, Kubernetes runs a container runtime such as Docker or CRI-O, and a set of components called kubelet, kube-proxy, and container networking interface (CNI).
Kubelet: The kubelet is responsible for managing the pods on the node. It communicates with the API server to receive instructions on what pods to run and ensures that they are running and healthy.
Kube-Proxy: The kube-proxy is responsible for networking on the node. It sets up the network routing rules to allow communication between the pods on the node and the rest of the cluster.
CNI: The container networking interface (CNI) is a plugin-based system that provides networking capabilities for the containers. It allows the pods to communicate with each other and with external systems.
Kubectl
kubectl is a command-line interface tool used for managing Kubernetes clusters. It allows users to interact with the Kubernetes API server and perform various operations such as deploying and scaling applications, checking the status of resources, and managing configurations.
With kubectl, users can create, modify, and delete Kubernetes resources such as pods, deployments, and services. They can also view logs and events for resources and monitor the overall health of the cluster.
Kubectl provides a wide range of options and commands that allow users to customize their Kubernetes experience according to their specific needs. It also supports various plugins and extensions that can be used to extend its functionality.
Kubectl is an essential tool for anyone working with Kubernetes, whether they are a developer, operator, or administrator. It provides a powerful and flexible interface for managing Kubernetes clusters, making it easier to deploy and manage containerized applications.