Kubernetes Tutorial 2026: Deploy Your First Cluster: Practical Guide
Step-by-step Kubernetes tutorial for deploying your first cluster. Learn installation, configuration, workload deployment, and troubleshooting.

On this page
TL;DR — Key takeaways
- Kubernetes requires a control plane node and at least one worker node, with kubectl as the primary interface for cluster management.
- Minikube provides the fastest local testing environment, while kubeadm enables production-grade multi-node cluster deployment.
- Every workload in Kubernetes runs inside pods, which are managed by higher-level objects like Deployments for automated scaling and recovery.
- Services expose pods to network traffic using ClusterIP for internal access or LoadBalancer for external connections.
- Namespace isolation and resource quotas prevent workload conflicts and enable multi-tenant cluster operations.
Kubernetes has become the standard platform for container orchestration, automating deployment, scaling, and management of containerized applications. Whether you're managing a small development environment or preparing infrastructure for production workloads, understanding how to deploy and operate a Kubernetes cluster is essential.
This tutorial walks you through deploying your first Kubernetes cluster from installation to running your first application. You'll learn the core components, installation methods, and practical troubleshooting steps that apply to any Kubernetes environment.
What Is Kubernetes and How Does It Work
Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and operation of application containers across clusters of hosts. It groups containers into logical units called pods and manages their lifecycle, networking, and storage.
A Kubernetes cluster consists of two main components: the control plane and worker nodes. The control plane runs the API server, scheduler, and controller manager that make decisions about the cluster. Worker nodes run the actual application containers using a container runtime like containerd or CRI-O.
When you deploy an application, Kubernetes schedules pods onto available nodes, monitors their health, and automatically restarts failed containers. Services provide stable network endpoints for accessing pods, while persistent volumes handle stateful data storage.
- Control plane: manages cluster state, scheduling, and API requests
- Worker nodes: run application containers and report status to control plane
- kubectl: command-line tool for interacting with the cluster API
- Container runtime: executes containers on each node (containerd, CRI-O)
- etcd: distributed key-value store that holds all cluster configuration data
Choose Your Installation Method
The installation method depends on your environment and use case. For local development and learning, Minikube creates a single-node cluster on your workstation. For production or multi-node testing, kubeadm provides a standard installation tool that works across different infrastructure providers.
Minikube is the fastest way to start learning. It runs Kubernetes inside a virtual machine or container and includes built-in add-ons for common services. Kubeadm requires more setup but gives you a cluster architecture that matches production environments.
Cloud providers like AWS, Google Cloud, and Azure offer managed Kubernetes services that handle control plane management. These simplify operations but abstract away cluster internals. Starting with a manual installation helps you understand the components before moving to managed services.
- Minikube: single-node cluster for local development on Windows, macOS, or Linux
- kubeadm: production-grade installation for multi-node clusters on bare metal or VMs
- kind: Kubernetes in Docker, useful for CI/CD testing and local multi-node simulation
- Managed services: EKS, GKE, AKS handle control plane maintenance and upgrades
Install Kubernetes with Minikube
Minikube installation requires a hypervisor or container runtime. On Linux, Docker provides the simplest option. On Windows and macOS, Hyper-V or VirtualBox work well. Install kubectl first, as it's the command-line tool you'll use to interact with any Kubernetes cluster.
Download kubectl from the official Kubernetes release page and add it to your system PATH. Verify the installation by running 'kubectl version --client'. Then install Minikube using the package manager for your operating system or download the binary directly.
Start your first cluster with 'minikube start'. This command downloads the Kubernetes components, creates a virtual machine or container, and configures kubectl to connect to your new cluster. The process takes several minutes on first run as it downloads container images.
- Install kubectl: download binary for your OS and add to PATH
- Install Minikube: use package manager (brew, choco, apt) or download binary
- Start cluster: run 'minikube start' and wait for initialization to complete
- Verify connection: run 'kubectl cluster-info' to confirm cluster is accessible
- Check node status: run 'kubectl get nodes' to see your single-node cluster
Deploy Your First Application
Kubernetes uses YAML manifests to define workloads. A Deployment manages a set of identical pods and ensures the desired number of replicas are running. Start with a simple nginx web server to understand the deployment process.
Create a deployment using 'kubectl create deployment nginx --image=nginx:latest'. This creates a Deployment object that manages one nginx pod. Check the deployment status with 'kubectl get deployments' and pod status with 'kubectl get pods'.
The pod runs but isn't accessible from outside the cluster yet. Expose it using 'kubectl expose deployment nginx --type=NodePort --port=80'. This creates a Service that routes traffic to the nginx pods. On Minikube, access the service using 'minikube service nginx' which opens your browser to the correct URL.
- Create deployment: 'kubectl create deployment nginx --image=nginx:latest'
- Check status: 'kubectl get pods' shows pod name, status, and restarts
- View logs: 'kubectl logs <pod-name>' displays container output
- Expose service: 'kubectl expose deployment nginx --type=NodePort --port=80'
- Access application: 'minikube service nginx' on local clusters, or use LoadBalancer IP on cloud
Understand Kubernetes Objects and Resources
Kubernetes organizes everything as objects stored in etcd. Pods are the smallest deployable units, containing one or more containers that share storage and network. Deployments provide declarative updates for pods and ReplicaSets, managing rollouts and rollbacks automatically.
Services abstract pod networking by providing a stable IP address and DNS name. ClusterIP services are only accessible within the cluster, NodePort services expose a port on every node, and LoadBalancer services request an external load balancer from your infrastructure provider.
Namespaces provide virtual clusters within a physical cluster, isolating resources and access controls. The default namespace is used when you don't specify one. System components run in kube-system, and you should create separate namespaces for different projects or teams.
- Pods: ephemeral units containing one or more containers with shared storage and network
- Deployments: declarative management of pod replicas with automated rollouts
- Services: stable network endpoints that route traffic to pods using label selectors
- Namespaces: logical isolation boundaries for resources and access control
- ConfigMaps and Secrets: external configuration and sensitive data storage
Scale and Update Your Application
Scaling in Kubernetes means changing the number of pod replicas. Scale your nginx deployment using 'kubectl scale deployment nginx --replicas=3'. Kubernetes immediately creates two additional pods and distributes them across available nodes.
Watch the scaling operation with 'kubectl get pods -w' which streams updates as pods are created. The Service automatically includes new pods in its routing pool without any additional configuration. Traffic is load-balanced across all healthy pods.
Update the application by changing the container image. Run 'kubectl set image deployment/nginx nginx=nginx:1.25' to trigger a rolling update. Kubernetes creates new pods with the updated image, waits for them to become ready, then terminates old pods. Check rollout status with 'kubectl rollout status deployment/nginx'.
- Scale up: 'kubectl scale deployment nginx --replicas=3' increases pod count
- Scale down: use '--replicas=1' to reduce resource usage
- Rolling update: 'kubectl set image deployment/nginx nginx=nginx:1.25' updates container version
- Monitor rollout: 'kubectl rollout status deployment/nginx' shows update progress
- Rollback: 'kubectl rollout undo deployment/nginx' reverts to previous version if update fails
Troubleshoot Common Cluster Issues
When pods fail to start, check their status with 'kubectl describe pod <pod-name>'. The Events section at the bottom shows why containers failed to create or start. Common issues include image pull errors, insufficient resources, or misconfigured volume mounts.
If a pod is running but not responding, check application logs with 'kubectl logs <pod-name>'. For pods with multiple containers, specify the container name with '-c <container-name>'. Add '--previous' to view logs from a crashed container.
Network connectivity problems often involve service configuration. Verify the service exists with 'kubectl get services' and check its endpoints with 'kubectl get endpoints <service-name>'. Empty endpoints mean no pods match the service's label selector.
- Pod won't start: run 'kubectl describe pod <name>' and check Events section for errors
- Image pull failures: verify image name, check registry access, ensure credentials are configured
- Insufficient resources: check node capacity with 'kubectl describe nodes' and adjust pod resource requests
- Service not routing: verify pod labels match service selector using 'kubectl describe service <name>'
- DNS resolution issues: test with 'kubectl run -it --rm debug --image=busybox --restart=Never -- nslookup kubernetes.default'
Quick troubleshooting checklist
- Install kubectl and verify version matches cluster compatibility
- Install Minikube or prepare nodes for kubeadm installation
- Start cluster and confirm control plane is healthy with 'kubectl cluster-info'
- Deploy test application and verify pod reaches Running state
- Create service and confirm application responds to requests
- Scale deployment to multiple replicas and verify load balancing
- Perform rolling update and verify zero-downtime deployment
- Configure persistent storage if application requires stateful data
- Set up namespace isolation for multi-tenant environments
- Document cluster access credentials and backup etcd configuration
FAQ
What is the minimum hardware required to run a Kubernetes cluster?
A minimal Kubernetes cluster requires at least 2 CPU cores and 2GB RAM for the control plane node, plus 1 CPU core and 1GB RAM for each worker node. For production workloads, use at least 4 CPU cores and 8GB RAM per node to handle system overhead and application demands. Minikube can run with 2 CPU cores and 2GB RAM for local development.
How do I access a Kubernetes cluster running on remote servers?
Access remote Kubernetes clusters by copying the kubeconfig file from the cluster's control plane to your local machine at ~/.kube/config. The kubeconfig contains cluster API server address, certificate authority data, and user credentials. Run 'kubectl config view' to verify configuration, and use 'kubectl config use-context <context-name>' to switch between multiple clusters.
What is the difference between a pod and a deployment?
A pod is the smallest deployable unit in Kubernetes containing one or more containers that share storage and network. A deployment is a higher-level controller that manages pods, providing declarative updates, automated rollouts, scaling, and self-healing capabilities. Pods are ephemeral and replaced when they fail, while deployments ensure the desired number of pod replicas always run.
How do I expose a Kubernetes application to the internet?
Expose applications to the internet by creating a Service with type LoadBalancer, which requests an external IP from your infrastructure provider. On cloud platforms, this automatically provisions a load balancer. For on-premises clusters, use an Ingress controller like nginx-ingress or Traefik to route external HTTP traffic to internal services. Configure DNS to point to the load balancer or ingress IP address.
Can I run Kubernetes on a single server for production?
Running production workloads on a single-node Kubernetes cluster is not recommended because it creates a single point of failure. If the node fails, both the control plane and applications become unavailable. Single-node clusters work for development, testing, or non-critical applications with planned downtime windows. For production, use at least three control plane nodes and two worker nodes to ensure high availability.
Related articles
- Hosting OperationsSelf-Hosted App Deployment Fails? Check DNS, SSL, Reverse Proxy, and Logs FirstTroubleshoot failed self-hosted app deployments by checking DNS, SSL, reverse proxy routing, container status, logs, and ports.
- Hosting OperationsSelf-Hosted PaaS on a VPS: What to Check Before Installing Coolify, Dokploy, or CapRoverA hosting support checklist for preparing a VPS before installing self-hosted PaaS tools like Coolify, Dokploy, or CapRover.
- Hosting OperationsLinux Server Security Lessons from the Arch Linux Malware Package IncidentPractical Linux server security checklist for VPS admins after package malware concerns, with safe checks, rollback steps, and support guidance.
- Hosting OperationsAWS Lightsail Hong Kong VPS Latency: Practical Hosting Guide for IndonesiaLearn how to test AWS Lightsail Hong Kong VPS latency, compare regions, migrate safely, and troubleshoot hosting performance.
- Hosting OperationsCloudflare Tomorrow Watchlist: A Practical Hosting Operations GuidePractical Cloudflare troubleshooting checklist for DNS, SSL, caching, WAF, origin health, safe testing, and rollback planning.
- Hosting OperationsNetwork Safety Checklist for AI Agent Skills in Hosting OperationsAudit AI agent skills safely with network checks, secret protection, sandbox testing, rollback steps, and hosting support troubleshooting guidance.