Read this article in: Portuguese (Português) · Spanish (Español)
To deploy applications with Kubernetes in a robust and scalable way, the most efficient method is to use configuration manifests (YAML) to declare the desired state of your system. Kubernetes, a container orchestration system, manages the entire lifecycle of your workload, ensuring that containers are automatically deployed, scaled, and kept running, regardless of node or infrastructure failures. Essentially, you don’t tell it “do this”; you tell it “I want the state to be this,” and the orchestrator handles reconciling that reality.
The relevance of Kubernetes is not new; the project was announced by Google on June 6, 2014, and conceived by contributors such as Joe Beda, Brendan Burns, and Craig McLuckie. Currently, it is maintained by a global community, and its trademark is held by the Cloud Native Computing Foundation (CNCF). This evolutionary journey, culminating in stable versions like 1.36/1.37.2, demonstrates its maturity and its ability to manage all types of workloads, making it a fundamental standard for modern data centers and cloud environments.
In this definitive guide, we will demystify the process of container orchestration. We will cover everything from understanding what an orchestrator is and why to use one, to the architecture and essential components of the cluster. Next, we will follow a practical step-by-step guide to deploying a basic application using YAML, advancing to managing scalability and complex configurations, and concluding with best practices for monitoring and security in production.
Key Points
- Kubernetes is an orchestrator that automates the lifecycle of containerized applications, ensuring stability and scalability.
- It ensures high availability by monitoring the cluster and automatically rescheduling affected containers if a node fails.
- The architecture divides the intelligence between the Control Plane (management) and the Nodes (container execution).
- The Deployment uses YAML manifests to declare the desired state, managing Pod replicas in a stable manner.
- The Service provides a stable IP address and performs load balancing for a group of Pods, regardless of their location.
What is and why use a container orchestrator

For those new to containerization, it is crucial to understand the difference between simply running a container and orchestrating an entire ecosystem of applications. This is where Kubernetes (K8s) comes in. In essence, Kubernetes is an open-source container orchestration system, originally developed by Google and maintained by the Cloud Native Computing Foundation. If you also need to understand the details of embedded processors, you can check out the guide on ARM Cortex-A7 complete specifications. It is not just a program; it is a set of tools and mechanisms that automate the entire lifecycle of your containerized applications.
If Docker is the engine that builds and runs the individual container, Kubernetes is the on-call manager that ensures these engines are always running, scaling them, and automatically replacing them if something fails. Instead of manually managing the deployment, scaling, and health of dozens or hundreds of containers on different machines, K8s allows you to declare the desired state of your system—for example, “I always want three instances of this service running”—and it handles the heavy lifting to maintain that reality.
Why is orchestration necessary?
The need for a robust orchestrator arises when your application requires high availability and scalability that a single server cannot provide. A modern production system is distributed, and if one server fails, the entire application can go down. K8s solves this by turning a set of physical or virtual machines into a single, cohesive cluster. It constantly monitors every component of this cluster. If a node (machine) fails, for example, K8s detects the deviation from the desired state and automatically reallocates the affected containers to a healthy node, ensuring the service remains online without manual intervention.
For this magic to happen, K8s operates with a complex, yet elegant architecture. It divides the intelligence into specialized components:
- API Server: Acts as the central interface, processing and validating all the commands you send.
- Scheduler: Is the brain that decides which specific node (machine) a new container should be placed on, based on available resources (CPU, memory) and policy rules.
- Controllers: Are the “reconciliation loops” that compare the cluster’s actual state with the state you declared and correct any discrepancies, like an automatic control system.
This ability to abstract physical complexity and ensure the system always returns to the desired state is what makes Kubernetes the industry standard tool for running applications at scale. By mastering K8s, you stop managing machines and start managing the logical state of your application, focusing only on your code and the end-user experience.
📊 Comparison: Container vs. Orchestrator
| Component | Primary Function | Analogy |
|---|---|---|
| Container (e.g., Docker) | Builds and runs an individual container. | The Engine |
| Kubernetes (K8s) | Manages the full lifecycle, scaling, and health of multiple containers. | The On-Call Manager |
Architecture and essential cluster components
To understand Kubernetes in depth, it is essential to distinguish the architecture into two parts: the Control Plane and the Nodes. If the Node represents the worker servers—the “muscles” that actually run the containers—the Control Plane is the brain that manages the entire ecosystem. It doesn’t run the workloads, but rather ensures that the desired state (what you declare in YAML) is maintained across all Nodes, coordinating communication and resources.
Control Plane Components
The heart of orchestration lies in interconnected components that form the Control Plane. The API Server is the entry point and central interface, exposing a REST API that receives and validates all commands arriving at the cluster, whether from a user or another component. It doesn’t just receive the command; it processes it and updates the state in a persistent repository: the etcd. etcd is a distributed, lightweight key-value store, crucial because it holds the configuration state of the entire cluster, ensuring the consistency of this data at all times.
With the state recorded in etcd, other intelligence components come into play. The Scheduler is the component that decides the exact location for execution. When a new Pod is created, the Scheduler queries etcd to see which resources are available on each Node, and then performs a “match” between the workload’s resource “demand” and the Node’s resource “supply.” Finally, the Controllers act as “reconciliation loops.” They are processes that constantly monitor whether the cluster’s actual state matches the desired state. If, for example, a Node fails, the Controller detects this divergence and triggers the necessary process to restore the replica count, ensuring high availability.
Workload and Management Units
At the execution level, the basic deployment unit is the Pod, which groups one or more containers that must run together and share network resources. For these Pods to communicate transparently, Services are used, as they provide a stable address and a network discovery point for the group of Pods, regardless of which Nodes they are running on. In terms of lifecycle management, mechanisms like ReplicaSet and Deployment are used to ensure stability and control updates and rollbacks, with Deployment being a higher level of abstraction that manages the ReplicaSet.
This entire architecture is robust enough to be extended. Through Custom Resource Definitions (CRDs), Kubernetes allows administrators to define and integrate resources that are not part of the core system, extending the automation power and the cluster’s API.
📌 Key Components of the Kubernetes Architecture
- Control Plane: The ‘brain’ that manages the desired state of the cluster.
- API Server: The entry point that receives and validates all cluster commands.
- etcd: The key-value store that keeps the persistent configuration state.
- Scheduler: Decides the exact location for Pod execution, performing resource matching.
- Controllers: Monitor the actual state and trigger corrections to maintain high availability.
- Pod: The basic deployment unit, grouping containers that share network resources.
Prerequisites and Local Environment Setup

For the theory of orchestration to come alive, it is essential to replicate a Kubernetes cluster environment on your local machine. This practical step ensures that you have all the necessary tools to interact with the system as if you were in a real cloud environment. Setting up this local environment requires special attention to prerequisites, especially regarding the container engine, as the ecosystem has undergone significant evolution.
Software and Runtime Prerequisites
The heart of any containerized application is the container runtime, responsible for the container lifecycle (launching, reconciliation, and stopping). Historically, the kubelet, a component that interacts with the runtime, was strongly tied to Docker. However, the standard has evolved. Between November 2020 and April 2022, dockershim was used to bridge this gap. However, with the release of version v1.24 in May 2022, official support for Docker as a runtime was completely removed. Currently, high-level implementations compatible with the CRI (Container Runtime Interface) include containerd and CRI-O, which are the recommended runtimes to ensure stability and adherence to the latest standards.
In addition to the runtime, you will need two crucial tools: kubectl, the official command-line tool for interacting with the cluster, and a tool that simulates the cluster itself, such as Minikube or Kind. These tools ensure that you can send commands safely and test deployments without infrastructure costs.
Configuring the Local Development Environment
Follow the steps below to ensure your environment is fully operational and ready for orchestration:
- Install a Compatible Runtime: Install a modern container runtime, such as
containerdorCRI-O, ensuring it is compatible with CRI standards. - Install Kubectl: Download and configure the latest version of
kubectl. This CLI will be used to send all management commands to the cluster. - Choose a Local Tool: Decide whether to use a local cluster tool (Minikube or Kind). These tools simplify setting up a cluster environment on personal machines.
- Initialize the Cluster: Run the initialization command for your chosen tool (e.g.,
minikube start). This process will create the Control Plane and Nodes within your virtual environment. - Verify Connectivity: After initialization, run
kubectl get nodes. The output should list the local node, confirming thatkubectlis correctly pointing to the newly created cluster. - Test Functionality: To confirm everything is working, run a simple command, such as
kubectl get services. If the command returns without errors, your environment is ready for development and testing.
By following these steps, you will have an isolated environment that is functionally identical to a production cluster. Furthermore, it is crucial to keep kubectl and the runtime updated to take advantage of the latest security and performance features of Kubernetes, especially when considering specific processors like the Allwinner H616 for embedded projects.
Step-by-step: Deploying a basic application with YAML
To get an application running using Kubernetes, it’s not enough to just know how to run a container; you must declare the desired state of your system. This is where the YAML manifest becomes crucial. It is the contract you establish with the cluster, specifying exactly how many pods should run, which image they should use, and how they should be accessible. In real-world applications, you generally need two types of resources: the Deployment and the Service.
Structuring the YAML Manifest
The Deployment is a high-level management mechanism that defines the desired state of your Pods and, in turn, manages a ReplicaSet. The ReplicaSet, in turn, ensures that a stable number of replicas of your pods is always active. To define this, you need to specify the image, the number of replicas, and the labels.
📘 Service
The Service is not the application itself, but rather a virtual network layer. It receives a stable IP address and a DNS name for the set of pods, regardless of which nodes they are running on, and performs load balancing.
Next, the Service takes action. It isn’t the application itself, but rather a virtual network layer. It receives a stable IP address and a DNS name for the set of pods, regardless of which nodes they are running on. It performs load balancing, distributing incoming traffic across all pods that match the labels defined in the service.
Step-by-step: Deploying a basic application with YAML
The deployment process is straightforward and powerful. Instead of interacting with each component manually, you declare everything in a single YAML file and let Kubernetes handle the rest.
- Creating the YAML manifest: Create a file (e.g.,
app.yaml) containing, at a minimum,DeploymentandServiceblocks. TheDeploymentmust define the image and the number of replicas (e.g.,replicas: 3). TheServicemust use aselectorthat matches the labels defined in theDeployment. - Applying the manifest: Run the command
kubectl apply -f app.yaml. This command instructs the cluster to read the file and ensure that all resources described within it exist and are in the desired state. - Monitoring the status: Use
kubectl get deploymentsto verify that the Deployment is in theavailablestate. - Checking the pods: Confirm that the desired number of replicas has been created by running
kubectl get pods. - Testing internal access: If other services within the cluster need to access your application, the
Servicehas already provided a stable IP address for them to use. - Exposing the application: For the outside world to access the application, the
Servicemust be configured with an exposure type (such asNodePortorLoadBalancer, depending on your environment), allowing access via the node’s IP address.
The magic of reconciliation
What makes this process robust is the concept of reconciliation. The Deployment and the ReplicaSet act as controllers: they are control loops that continuously observe the cluster’s current state and compare it to the desired state. If a node fails and a pod crashes, the ReplicaSet detects this discrepancy and automatically starts a new replacement pod, ensuring that the replica count (for example, 3) is always maintained, without manual intervention.
In summary, you simply declare the goal—”I want three replicas running this image”—and Kubernetes takes care of keeping the system operational, managing failures, updates, and network traffic via the Service. It is this capability for automatic control that elevates container orchestration to a mission-critical infrastructure level.
Advanced management: Configurations and scalability

Mastering a Kubernetes cluster goes far beyond simply applying YAML manifests. In a production environment, the focus shifts to the system’s robustness, security, and adaptability. Advanced management requires developers to adopt practices that separate configuration from code and anticipate variations in load and data state.
Managing Configurations and Secrets
One of the most common challenges in applications is determining where and how to store configuration information. Kubernetes resolves this elegantly with two logical objects: ConfigMaps and Secrets. Both allow configuration changes to be made without needing to recompile or redeploy the application, a crucial advancement for development agility.
🧪 Configuring Applications: ConfigMaps vs. Secrets
To differentiate between using ConfigMaps and Secrets, think of it this way: use a ConfigMap for general configuration data, such as a properties JSON. The Secret, on the other hand, should be reserved exclusively for sensitive information, like passwords or SSH keys. Both allow you to change the configuration without redeploying the application code.
The ConfigMap is ideal for storing configuration data in a key-value format, such as individual properties or even entire documents (JSON, XML). The Secret is specifically for sensitive and confidential data, such as passwords, SSH keys, or image registry credentials. It is crucial to understand that, although Secrets are designed for security, they are not encrypted at rest by default, requiring additional configurations to ensure maximum protection.
Regardless of the type, ConfigMap and Secret data are injected into Pods and can be accessed in two ways: as environment variables, consumed by the kubelet when starting the container; or mounted within a volume, which even allows for automatic data reloading without taking down the container.
Types of Workloads
Not all applications are the same. It is essential to differentiate the type of state your service requires. For stateless applications (like a web server processing independent requests), the Deployment is the standard mechanism, as it only declares the desired number of replicas, and Kubernetes handles maintaining that state.
However, when dealing with stateful applications, such as databases or messaging systems (exemplified by Apache Kafka), the StatefulSet must be used. These controllers ensure not only the maintenance of replicas but also the uniqueness and order of instances. This is critical because, in a high-availability database, for example, there is a clear notion of primary and secondary instances, and the state must be preserved during restarts or scaling. To better understand the processing power required for such systems, it is worth checking the guide on ARM Cortex-A720: full specifications.
Dynamic Scalability
Finally, a production architecture should never be static. To automatically handle traffic spikes, the Horizontal Pod Autoscaler (HPA) is the key component. Instead of manually scaling the number of replicas, the HPA monitors metrics (such as CPU or memory usage) and automatically adjusts the number of Pods, ensuring the system remains performant and resilient without human intervention.
Monitoring, Security, and Production Best Practices
Taking a container from development to a robust production environment goes far beyond simply applying YAML manifests. Mastering a Kubernetes cluster requires adopting software engineering and DevOps practices that ensure stability, security, and traceability. For a system to be truly “production-ready,” it is essential to implement layers of control and isolation.
Environment Isolation and Governance
One of the first steps is the logical segmentation of resources using Namespaces. Namespaces are logical divisions of data plane resources and are crucial for separating environments—such as development (dev), staging, and production (prod)—within a single cluster. This separation not only organizes the cluster but also limits the scope of impact from failures or failed tests. Concurrently, security must be managed by Role-Based Access Control (RBAC). RBAC is the mechanism that allows limiting the permissions of each user or service, adhering to the principle of least privilege. Instead of granting broad access, RBAC ensures that components can only interact with the resources strictly necessary for their function.
Observability and State Management
Maintaining total visibility of the system is a pillar of production operations. This involves observability, which rests on three pillars: logging, metrics, and tracing. It is essential to integrate logging tools, such as the ELK stack, to centralize and analyze logs from all applications. Furthermore, real-time metric monitoring is vital for identifying bottlenecks before they cause downtime. Regarding storage, it is crucial to understand the difference between ephemeral and persistent volumes. By default, container storage is ephemeral, meaning it disappears when the container stops. For stateful applications, such as databases, persistent Volumes must be used, which provide durable storage accessible by all containers within a Pod.
Update and Resilience Strategies
The production architecture should never be static. Application updates must be conducted with minimal downtime. To achieve this, the concept of Rolling Updates is used. Instead of taking down and bringing up the entire service at once, Kubernetes gradually replaces old replicas with new ones. This strategy ensures that traffic is continuously served while the upgrade process occurs, maximizing availability. Finally, to ensure the longevity and credibility of the system, it is important to know that Kubernetes is a project developed by the Cloud Native Computing Foundation (CNCF) and that its evolution, as demonstrated by stable versions like 1.36 and 1.37.2 (as of October 28, 2026), reflects a mature and constantly improving ecosystem.
Glossary
- Pod: The smallest deployable unit, which groups one or more containers so they can share network resources.
- Service: A virtual network layer that provides a stable IP address and performs load balancing for a group of Pods.
- Deployment: A high-level mechanism that defines the desired state of a set of Pods and manages updates and rollbacks.
- Control Plane: The ‘brain’ of Kubernetes. It is the set of components that ensures the cluster’s actual state matches the desired state.
- etcd: A distributed key-value store, crucial for storing the configuration state and data for the entire Kubernetes cluster.
- Scheduler: The component that decides the most suitable node (machine) to run a new Pod on, based on available resources (CPU, memory).
Frequently Asked Questions
What is the difference between Docker and Kubernetes?
Docker is primarily a tool for building and running an individual container. Kubernetes, on the other hand, is an orchestration system that acts as an on-call manager. It not only runs but also monitors, scales, and maintains the state of an entire ecosystem of containerized applications.
Do I need a dedicated server to run Kubernetes?
While large-scale production environments require dedicated infrastructure, you can start learning and testing the concept on local machines. Tools like Minikube or Kind simulate a complete cluster, allowing you to practice orchestration without infrastructure costs.
How do I expose my application running on Kubernetes to the internet?
For the outside world to access the service, you must configure the Service with an appropriate exposure type. This usually involves a gateway or Ingress mechanism, which directs external traffic securely and routed to the internal set of Pods.
What is a Pod and why is it the basic deployment unit?
A Pod is the smallest deployment unit in Kubernetes. It serves to group one or more containers that need to run together and share network resources. By grouping the containers, the Pod ensures that they communicate in a transparent and cohesive manner, like a single logical service.
Is Kubernetes expensive? What are the costs involved?
Kubernetes itself is open-source software. The costs are not related to licensing, but rather to complexity and operation. The main investment is in technical knowledge to configure, maintain, and optimize the architecture. Additionally, there are infrastructure costs (servers and storage) to run the cluster in production.
Conclusion
Mastering Kubernetes means transcending the management of physical servers and embracing the logic of desired state. Instead of worrying about the failure of a node or the complexity of load balancing across multiple machines, the orchestrator takes on this responsibility. It transforms a distributed set of resources into a cohesive system, constantly monitoring the environment and ensuring that the application remains online and scalable, even in the face of unexpected failures.
The K8s architecture, anchored by the Control Plane and components like the API Server and Controllers, provides the necessary intelligence for this magic to happen. By declaring the ideal state—for example, “always maintain three active replicas”—the system takes care of orchestrating the entire lifecycle, from resource allocation by the Scheduler to traffic routing by the Services. Understanding modern runtimes, such as containerd, and manipulating Pods and Deployments are the practical pillars for transforming this theory into a robust production environment.
Kubernetes is not just another tool; it is the industry standard that allows developers to focus on code while the infrastructure handles resilience and scale. Now that you understand the synergy between desired state and reconciliation mechanisms, the next step is to get hands-on. Start configuring your local environment with tools like Minikube and begin applying the concept of declared state to a real project.




