Introduction to Kubernetes
Container orchestration at scale
Kubernetes (K8s) is an open-source container orchestration platform that automates deploying, scaling, and managing containerized applications. Originally designed by Google, it's now maintained by the Cloud Native Computing Foundation (CNCF).
Our managed Kubernetes offering is built on K3s — a lightweight, CNCF-certified Kubernetes distribution packaged as a single binary (under 100MB). K3s provides full Kubernetes API compatibility with built-in Traefik ingress, Flannel CNI, and embedded etcd, making it ideal for cloud VMs, bare metal, and edge deployments.
Why Kubernetes?#
Container orchestration#
Kubernetes manages containers across multiple hosts, handling scheduling, scaling, and self-healing automatically.
Declarative configuration#
Define the desired state of your application, and Kubernetes ensures the actual state matches.
Scalability#
Easily scale applications up or down based on demand, either manually or automatically.
Self-healing#
Kubernetes restarts failed containers, replaces and reschedules containers when nodes die, and kills containers that don't respond to health checks.
When to Use Kubernetes
Kubernetes excels for microservices, stateless applications, and workloads requiring high availability. For simple applications or small teams, consider managed platforms (Heroku, Render) or serverless options first—Kubernetes adds operational complexity.
Core concepts#
Pods#
A Pod is the smallest deployable unit in Kubernetes. It represents one or more containers that share storage and network resources.
1apiVersion: v12kind: Pod3metadata:4 name: nginx-pod5spec:6 containers:7 - name: nginx8 image: nginx:1.249 ports:10 - containerPort: 80Deployments#
Deployments manage the desired state for Pods and ReplicaSets, enabling declarative updates.
1apiVersion: apps/v12kind: Deployment3metadata:4 name: nginx-deployment5spec:6 replicas: 37 selector:8 matchLabels:9 app: nginx10 template:11 metadata:12 labels:13 app: nginx14 spec:15 containers:16 - name: nginx17 image: nginx:1.2418 ports:19 - containerPort: 80Services#
Services provide stable network endpoints for accessing Pods.
1apiVersion: v12kind: Service3metadata:4 name: nginx-service5spec:6 selector:7 app: nginx8 ports:9 - port: 8010 targetPort: 8011 type: LoadBalancerConfigMaps and Secrets#
ConfigMaps store non-confidential configuration data, while Secrets store sensitive information.
1apiVersion: v12kind: ConfigMap3metadata:4 name: app-config5data:6 DATABASE_HOST: "db.example.com"7 LOG_LEVEL: "info"Secrets Are Not Encrypted
Kubernetes Secrets are base64-encoded, not encrypted. For production, use external secret management (Vault, AWS Secrets Manager) with tools like External Secrets Operator or Sealed Secrets.
Namespaces#
Namespaces provide a way to divide cluster resources between multiple users or teams.
1apiVersion: v12kind: Namespace3metadata:4 name: productionArchitecture#
Control plane#
The control plane manages the overall state of the cluster:
- API Server: The front-end for the Kubernetes control plane
- etcd: Consistent and highly-available key-value store
- Scheduler: Assigns Pods to nodes
- Controller Manager: Runs controller processes
Worker nodes#
Worker nodes run your containerized applications:
- kubelet: Ensures containers are running in Pods
- kube-proxy: Maintains network rules
- Container runtime: Runs containers (e.g., containerd, CRI-O)
Basic commands#
1# Get cluster information2kubectl cluster-info34# List all pods5kubectl get pods67# Create resources from a file8kubectl apply -f deployment.yaml910# View logs11kubectl logs <pod-name>1213# Execute command in a container14kubectl exec -it <pod-name> -- /bin/bash1516# Delete resources17kubectl delete -f deployment.yamlIntegration with DevOps Hub#
Deploy to Kubernetes from DevOps Hub pipelines:
1stages:2 - name: deploy3 jobs:4 - name: deploy-to-k8s5 runner: ubuntu-latest6 steps:7 - checkout8 - run: |9 kubectl apply -f k8s/10 kubectl rollout status deployment/my-appNext steps#
Related Resources#
- Kubernetes Management Services — Managed K8s support and migration
- Kubernetes Training — CKA, CKAD, and CKS certification prep
- GitOps — Declarative Kubernetes deployments with ArgoCD and Flux
- Docker Introduction — Container fundamentals