# Concepts

This is the multi-page printable view of this section. Click here to print.Return to the regular view of this page.Concepts1: Overview1.1: Kubernetes Components1.2: Objects In Kubernetes1.2.1: Kubernetes Object Management1.2.2: Object Names and IDs1.2.3: Labels and Selectors1.2.4: Namespaces1.2.5: Annotations1.2.6: Field Selectors1.2.7: Finalizers1.2.8: Owners and Dependents1.2.9: Recommended Labels1.3: The Kubernetes API2: Cluster Architecture2.1: Nodes2.2: Communication between Nodes and the Control Plane2.3: Controllers2.4: Leases2.5: Cloud Controller Manager2.6: About cgroup v22.7: Kubernetes Self-Healing2.8: Container Runtime Interface (CRI)2.9: Garbage Collection2.10: Mixed Version Proxy3: Containers3.1: Images3.2: Container Environment3.3: Runtime Class3.4: Container Lifecycle Hooks4: Workloads4.1: Pods4.1.1: Pod Lifecycle4.1.2: Init Containers4.1.3: Sidecar Containers4.1.4: Ephemeral Containers4.1.5: Disruptions4.1.6: Pod Hostname4.1.7: Pod Quality of Service Classes4.1.8: User Namespaces4.1.9: Downward API4.2: Workload Management4.2.1: Deployments4.2.2: ReplicaSet4.2.3: StatefulSets4.2.4: DaemonSet4.2.5: Jobs4.2.6: Automatic Cleanup for Finished Jobs4.2.7: CronJob4.2.8: ReplicationController4.3: Autoscaling Workloads4.4: Managing Workloads5: Services, Load Balancing, and Networking5.1: Service5.2: Ingress5.3: Ingress Controllers5.4: Gateway API5.5: EndpointSlices5.6: Network Policies5.7: DNS for Services and Pods5.8: IPv4/IPv6 dual-stack5.9: Topology Aware Routing5.10: Networking on Windows5.11: Service ClusterIP allocation5.12: Service Internal Traffic Policy6: Storage6.1: Volumes6.2: Persistent Volumes6.3: Projected Volumes6.4: Ephemeral Volumes6.5: Storage Classes6.6: Volume Attributes Classes6.7: Dynamic Volume Provisioning6.8: Volume Snapshots6.9: Volume Snapshot Classes6.10: CSI Volume Cloning6.11: Storage Capacity6.12: Node-specific Volume Limits6.13: Volume Health Monitoring6.14: Windows Storage7: Configuration7.1: Configuration Best Practices7.2: ConfigMaps7.3: Secrets7.4: Liveness, Readiness, and Startup Probes7.5: Resource Management for Pods and Containers7.6: Organizing Cluster Access Using kubeconfig Files7.7: Resource Management for Windows nodes8: Security8.1: Cloud Native Security and Kubernetes8.2: Pod Security Standards8.3: Pod Security Admission8.4: Service Accounts8.5: Pod Security Policies8.6: Security For Linux Nodes8.7: Security For Windows Nodes8.8: Controlling Access to the Kubernetes API8.9: Role Based Access Control Good Practices8.10: Good practices for Kubernetes Secrets8.11: Multi-tenancy8.12: Hardening Guide - Authentication Mechanisms8.13: Hardening Guide - Scheduler Configuration8.14: Kubernetes API Server Bypass Risks8.15: Linux kernel security constraints for Pods and containers8.16: Security Checklist8.17: Application Security Checklist9: Policies9.1: Limit Ranges9.2: Resource Quotas9.3: Process ID Limits And Reservations9.4: Node Resource Managers10: Scheduling, Preemption and Eviction10.1: Kubernetes Scheduler10.2: Assigning Pods to Nodes10.3: Pod Overhead10.4: Pod Scheduling Readiness10.5: Pod Topology Spread Constraints10.6: Taints and Tolerations10.7: Scheduling Framework10.8: Dynamic Resource Allocation10.9: Scheduler Performance Tuning10.10: Resource Bin Packing10.11: Pod Priority and Preemption10.12: Node-pressure Eviction10.13: API-initiated Eviction11: Cluster Administration11.1: Node Shutdowns11.2: Swap memory management11.3: Node Autoscaling11.4: Certificates11.5: Cluster Networking11.6: Admission Webhook Good Practices11.7: Good practices for Dynamic Resource Allocation as a Cluster Admin11.8: Logging Architecture11.9: Compatibility Version For Kubernetes Control Plane Components11.10: Metrics For Kubernetes System Components11.11: Metrics for Kubernetes Object States11.12: System Logs11.13: Traces For Kubernetes System Components11.14: Proxies in Kubernetes11.15: API Priority and Fairness11.16: Installing Addons11.17: Coordinated Leader Election12: Windows in Kubernetes12.1: Windows containers in Kubernetes12.2: Guide for Running Windows Containers in Kubernetes13: Extending Kubernetes13.1: Compute, Storage, and Networking Extensions13.1.1: Network Plugins13.1.2: Device Plugins13.2: Extending the Kubernetes API13.2.1: Custom Resources13.2.2: Kubernetes API Aggregation Layer13.3: Operator patternThe Concepts section helps you learn about the parts of the Kubernetes system and the abstractions Kubernetes uses to represent your cluster, and helps you obtain a deeper understanding of how Kubernetes works.1 - OverviewKubernetes is a portable, extensible, open source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.This page is an overview of Kubernetes.The name Kubernetes originates from Greek, meaning helmsman or pilot. K8s as an abbreviation results from counting the eight letters between the "K" and the "s". Google open-sourced the Kubernetes project in 2014. Kubernetes combines over 15 years of Google's experience running production workloads at scale with best-of-breed ideas and practices from the community.Why you need Kubernetes and what it can doContainers are a good way to bundle and run your applications. In a production environment, you need to manage the containers that run the applications and ensure that there is no downtime. For example, if a container goes down, another container needs to start. Wouldn't it be easier if this behavior was handled by a system?That's how Kubernetes comes to the rescue! Kubernetes provides you with a framework to run distributed systems resiliently. It takes care of scaling and failover for your application, provides deployment patterns, and more. For example: Kubernetes can easily manage a canary deployment for your system.Kubernetes provides you with:Service discovery and load balancing Kubernetes can expose a container using the DNS name or using their own IP address. If traffic to a container is high, Kubernetes is able to load balance and distribute the network traffic so that the deployment is stable.Storage orchestration Kubernetes allows you to automatically mount a storage system of your choice, such as local storages, public cloud providers, and more.Automated rollouts and rollbacks You can describe the desired state for your deployed containers using Kubernetes, and it can change the actual state to the desired state at a controlled rate. For example, you can automate Kubernetes to create new containers for your deployment, remove existing containers and adopt all their resources to the new container.Automatic bin packing You provide Kubernetes with a cluster of nodes that it can use to run containerized tasks. You tell Kubernetes how much CPU and memory (RAM) each container needs. Kubernetes can fit containers onto your nodes to make the best use of your resources.Self-healing Kubernetes restarts containers that fail, replaces containers, kills containers that don't respond to your user-defined health check, and doesn't advertise them to clients until they are ready to serve.Secret and configuration management Kubernetes lets you store and manage sensitive information, such as passwords, OAuth tokens, and SSH keys. You can deploy and update secrets and application configuration without rebuilding your container images, and without exposing secrets in your stack configuration.Batch execution In addition to services, Kubernetes can manage your batch and CI workloads, replacing containers that fail, if desired.Horizontal scaling Scale your application up and down with a simple command, with a UI, or automatically based on CPU usage.IPv4/IPv6 dual-stack Allocation of IPv4 and IPv6 addresses to Pods and ServicesDesigned for extensibility Add features to your Kubernetes cluster without changing upstream source code.What Kubernetes is notKubernetes is not a traditional, all-inclusive PaaS (Platform as a Service) system. Since Kubernetes operates at the container level rather than at the hardware level, it provides some generally applicable features common to PaaS offerings, such as deployment, scaling, load balancing, and lets users integrate their logging, monitoring, and alerting solutions. However, Kubernetes is not monolithic, and these default solutions are optional and pluggable. Kubernetes provides the building blocks for building developer platforms, but preserves user choice and flexibility where it is important.Kubernetes:Does not limit the types of applications supported. Kubernetes aims to support an extremely diverse variety of workloads, including stateless, stateful, and data-processing workloads. If an application can run in a container, it should run great on Kubernetes.Does not deploy source code and does not build your application. Continuous Integration, Delivery, and Deployment (CI/CD) workflows are determined by organization cultures and preferences as well as technical requirements.Does not provide application-level services, such as middleware (for example, message buses), data-processing frameworks (for example, Spark), databases (for example, MySQL), caches, nor cluster storage systems (for example, Ceph) as built-in services. Such components can run on Kubernetes, and/or can be accessed by applications running on Kubernetes through portable mechanisms, such as the Open Service Broker.Does not dictate logging, monitoring, or alerting solutions. It provides some integrations as proof of concept, and mechanisms to collect and export metrics.Does not provide nor mandate a configuration language/system (for example, Jsonnet). It provides a declarative API that may be targeted by arbitrary forms of declarative specifications.Does not provide nor adopt any comprehensive machine configuration, maintenance, management, or self-healing systems.Additionally, Kubernetes is not a mere orchestration system. In fact, it eliminates the need for orchestration. The technical definition of orchestration is execution of a defined workflow: first do A, then B, then C. In contrast, Kubernetes comprises a set of independent, composable control processes that continuously drive the current state towards the provided desired state. It shouldn't matter how you get from A to C. Centralized control is also not required. This results in a system that is easier to use and more powerful, robust, resilient, and extensible.Historical context for KubernetesLet's take a look at why Kubernetes is so useful by going back in time.Traditional deployment era:Early on, organizations ran applications on physical servers. There was no way to define resource boundaries for applications in a physical server, and this caused resource allocation issues. For example, if multiple applications run on a physical server, there can be instances where one application would take up most of the resources, and as a result, the other applications would underperform. A solution for this would be to run each application on a different physical server. But this did not scale as resources were underutilized, and it was expensive for organizations to maintain many physical servers.Virtualized deployment era:As a solution, virtualization was introduced. It allows you to run multiple Virtual Machines (VMs) on a single physical server's CPU. Virtualization allows applications to be isolated between VMs and provides a level of security as the information of one application cannot be freely accessed by another application.Virtualization allows better utilization of resources in a physical server and allows better scalability because an application can be added or updated easily, reduces hardware costs, and much more. With virtualization you can present a set of physical resources as a cluster of disposable virtual machines.Each VM is a full machine running all the components, including its own operating system, on top of the virtualized hardware.Container deployment era:Containers are similar to VMs, but they have relaxed isolation properties to share the Operating System (OS) among the applications. Therefore, containers are considered lightweight. Similar to a VM, a container has its own filesystem, share of CPU, memory, process space, and more. As they are decoupled from the underlying infrastructure, they are portable across clouds and OS distributions.Containers have become popular because they provide extra benefits, such as:Agile application creation and deployment: increased ease and efficiency of container image creation compared to VM image use.Continuous development, integration, and deployment: provides for reliable and frequent container image build and deployment with quick and efficient rollbacks (due to image immutability).Dev and Ops separation of concerns: create application container images at build/release time rather than deployment time, thereby decoupling applications from infrastructure.Observability: not only surfaces OS-level information and metrics, but also application health and other signals.Environmental consistency across development, testing, and production: runs the same on a laptop as it does in the cloud.Cloud and OS distribution portability: runs on Ubuntu, RHEL, CoreOS, on-premises, on major public clouds, and anywhere else.Application-centric management: raises the level of abstraction from running an OS on virtual hardware to running an application on an OS using logical resources.Loosely coupled, distributed, elastic, liberated micro-services: applications are broken into smaller, independent pieces and can be deployed and managed dynamically – not a monolithic stack running on one big single-purpose machine.Resource isolation: predictable application performance.Resource utilization: high efficiency and density.What's