Kubernetes Overview
Kubernetes Overview
Kubernetes is essentially a cluster of servers that can run specific programs on each node to manage containers within the nodes. Its main goal is to automate resource management. Kubernetes primarily provides the following key features:
Key Features of Kubernetes
1. Self-healing
If a container crashes, Kubernetes can quickly launch a new container within approximately 1 second to replace the failed one.
2. Elastic Scaling
Kubernetes can automatically adjust the number of containers running in the cluster based on demand.
3. Service Discovery
Services can automatically discover the services they depend on, facilitating dynamic and flexible communication between different services.
4. Load Balancing
When a service runs multiple containers, Kubernetes automatically balances the incoming requests among the containers to distribute the load.
5. Version Rollback
If a new version of an application is found to have issues, Kubernetes allows a quick rollback to the previous version.
6. Storage Orchestration
Kubernetes can automatically create storage volumes based on the requirements of the containers, ensuring proper storage management.
Concepts
1. Master
The master node is the control node of the cluster. Every Kubernetes cluster requires at least one master node responsible for managing the cluster.
2. Node
Nodes are the worker nodes where containers are scheduled and run. The master node assigns containers to these worker nodes, and Docker (or other container runtimes) on the node is responsible for running the containers.
3. Pod
A Pod is the smallest and simplest unit in Kubernetes. Containers run inside a Pod, and a Pod can contain one or more containers that share the same network, storage, and specification.
4. Controller
Controllers are used to manage Pods. They perform tasks such as starting, stopping, and scaling the number of Pods. Controllers ensure that the desired state of the cluster is maintained.
5. Service
A Service is a unified entry point for accessing Pods from outside the cluster. It can manage and expose multiple Pods of the same kind, providing load balancing and service discovery.
6. Label
Labels are key-value pairs used for categorizing Pods. Pods that belong to the same category or group will have the same label, making it easier to organize and manage them.
7. Namespace
A Namespace is used to isolate different environments or workloads within the same Kubernetes cluster. It helps in dividing cluster resources into logical units, providing a way to manage and organize Pods in a multi-tenant environment.