Kubernetes Flashcards
What is a Kubernetes
Kubernetes is an open-source platform designed to automate the deployment, scaling, and operation of containerized applications. It provides a robust framework for running distributed systems resiliently, managing containerized applications across clusters of hosts.
What are the main components of Kubernetes architecture?
Master Node: Manages the Kubernetes cluster and coordinates all activities. It includes components like the API server, etcd (key-value store), controller manager, and scheduler.
Worker Nodes: Run the containerized applications. Each node contains components like the kubelet, kube-proxy, and container runtime (e.g., Docker).
Pods: The smallest deployable units in Kubernetes, which can contain one or more containers.
Services: Abstracts a set of pods and provides a stable endpoint for accessing them.
Scheduler
Is responsible for assigning pods to worker nodes based on resource requirements, node affinity/anti-affinity rules, and other constraints. It ensures efficient utilization of resources and evenly distributes the workload across the cluster. The scheduler considers factors like resource availability, pod affinity/anti-affinity, and user-defined policies while making scheduling decisions.
Kube-apiserver
Is the central management entity of the Kubernetes control plane. It exposes the Kubernetes API, which is used by all other components to interact with the cluster. The API server processes RESTful requests to manage and orchestrate Kubernetes resources like Pods, Services, and Replication Controllers.
Controller Management
Runs controllers that regulate the state of the cluster. Each controller is a loop that watches the state of the cluster through the API server and makes changes to move the current state towards the desired state.
Kubelet
Is the primary node agent that runs on each node. It ensures that containers described in PodSpecs are running and healthy. The kubelet registers the node with the API server and manages the lifecycle of containers on the node.
ETCD
Is a distributed key-value store used to store all cluster data. It provides a reliable way to store configuration data, state data, and metadata. etcd ensures data consistency across the cluster using the Raft consensus algorithm, making it a critical component for maintaining the cluster’s state.
Heapster
Is a cluster-wide aggregator of data provided by Kubelet running on each node. This container management tool is supported natively on Kubernetes cluster and runs as a pod, just like any other pod in the cluster. So, it basically discovers all nodes in the cluster and queries usage information from the Kubernetes nodes in the cluster, via on-machine Kubernetes agent.
Kube-Proxy
Is a network proxy that runs on each node. It maintains network rules for forwarding connections to Service endpoints. kube-proxy can perform simple TCP, UDP, and SCTP stream forwarding or round-robin forwarding across a set of backends. It ensures that network traffic is properly routed to the correct Pods.
Kube-DNS or CoreDNS
Provides DNS resolution within the cluster. It allows Pods to discover and communicate with each other using DNS names instead of direct IP addresses.
Metrics-server
Collects resource usage metrics (CPU, memory, etc.) from nodes and Pods and provides them to Kubernetes Horizontal Pod Autoscaler (HPA) and other components for scaling decisions.
Ingress
Is an API object that provides external access to services within a cluster. It acts as an entry point for external traffic and handles routing and load balancing to the appropriate backend services. Ingresses are typically implemented using ingress controllers, which are responsible for processing and fulfilling incoming requests based on the defined rules and configurations. Ingress enables the use of HTTP and HTTPS-based routing, SSL termination, path-based routing, and host-based routing for applications running in Kubernetes.
Namespaces
Provide a way to logically isolate and partition resources within a cluster. They allow multiple virtual clusters to coexist within the same physical cluster. Namespaces provide a scope for resource names, such as pods, services, or deployments, and help avoid naming conflicts. They also enable RBAC (Role-Based Access Control) and resource quota management, allowing fine-grained control and resource allocation for different teams or projects.
Deployment
Manages the lifecycle of a set of pods. It provides declarative updates for rolling out changes to the application, including scaling, rolling updates, and rollback capabilities. A Deployment ensures that the desired number of pods are running and maintains the application’s desired state.