API / Kubernetes Interview questions
Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications.
A container is a lightweight, standalone, executable software package that includes everything needed to run an application, including code, runtime, system tools, libraries, and settings.
Kubernetes automates application deployment, scaling, and management, making it easy to deploy and manage container-based applications at scale.
Other benefits include:
- Simplified application management,
- Improved scaling and availability,
- Easy deployment and rollback,
- Improved resource utilization,
- Increased portability and flexibility.
A Kubernetes cluster is a set of nodes that run containerized applications managed by the Kubernetes control plane.
A node is a worker machine in Kubernetes that runs containerized applications.
A pod is the smallest deployable unit in Kubernetes that represents a single instance of a running process in a container.
The Kubernetes control plane is a set of components that manages and orchestrates the Kubernetes cluster.
It includes the following components:
- API server,
- etcd,
- kube-scheduler,
- kube-controller-manager,
- cloud-controller-manager,
The API server is the front-end interface for the Kubernetes control plane that exposes the Kubernetes API.
etcd is a distributed, reliable, and highly available key-value store used to store the configuration data for the Kubernetes cluster.
The Kubernetes scheduler is responsible for scheduling pods to run on available nodes in the cluster based on available resources and other scheduling requirements.
The kube-controller-manager is responsible for running various controller processes that monitor the state of the cluster and make changes as necessary.
The cloud-controller-manager is responsible for managing integration with cloud providers, such as AWS, GCP, or Azure.
A Kubernetes worker node is a physical or virtual machine that runs containerized applications and services.
It includes the following components:
- The kubelet is an agent that runs on each node and communicates with the Kubernetes API server to manage the container lifecycle.
- kube-proxy
- The kube-proxy is responsible for managing network routing between pods and services in the Kubernetes cluster.
- A container runtime is responsible for starting and stopping containers on a node. Examples include Docker, containerd, and CRI-O.
Namespaces in Kubernetes are used for dividing cluster resources between users. It helps the environment where more than one user spread projects or teams and provides a scope of resources.
A Kubernetes service is an abstraction layer that exposes a set of pods as a network service, allowing them to communicate with each other and with other services outside the cluster.
Kubernetes DNS is a service that provides DNS resolution for services and pods in a Kubernetes cluster.
A pod network is a network overlay that connects pods in a Kubernetes cluster.
The Kubernetes CNI is a specification that defines a standardized interface for integrating with container networking plugins.