Kubernetes on Linux: Core Concepts and CKA Exam Prep
Kubernetes (K8s) is a container orchestration platform that automates deployment, scaling, and management of applications. If you already use Docker, Kubernetes is the next step to run containers at scale, with high availability and automatic failure recovery.
Docker vs Kubernetes
The most important distinction before starting:
- Docker solves: how to package and run an application in a container
- Docker Compose solves: how to orchestrate multiple containers on a single machine
- Kubernetes solves: how to manage containers in a cluster of N machines with auto-scaling and zero-downtime
For projects with 1–3 services on a single machine, Docker Compose is sufficient. Kubernetes makes sense when you need to scale horizontally or ensure high availability.
Fundamental Concepts
Node
A machine (physical or VM) that is part of the cluster. The Control Plane (formerly Master) manages the cluster. Worker Nodes run the containers.
Pod
The smallest unit in Kubernetes. Contains 1 or more containers that share network and storage. Pods are ephemeral — they can die and be reborn with another IP at any time.
Deployment
Describes the desired state of a set of Pods: how many replicas, which image to use, update strategy (rolling update). Kubernetes ensures that the actual state matches the desired state.
Service
Since Pods have dynamic IPs, the Service provides a fixed address (IP or internal DNS) to access them. Types: ClusterIP (internal), NodePort (port on node), LoadBalancer (external IP via cloud).
Namespace
Divides the cluster into isolated environments. Example: producao, staging, dev — each with their own resources and policies.
kubectl: The Essential Command
# Ver os nodes do cluster
kubectl get nodes
# Ver todos os pods em todos os namespaces
kubectl get pods -A
# Criar um deployment de nginx
kubectl create deployment nginx --image=nginx
# Escalar para 3 réplicas
kubectl scale deployment nginx --replicas=3
# Expor como serviço
kubectl expose deployment nginx --port=80 --type=LoadBalancer
# Ver logs de um pod
kubectl logs nome-do-pod
# Executar shell dentro de um container
kubectl exec -it nome-do-pod -- /bin/bash
# Debugar um recurso
kubectl describe pod nome-do-pod
# Deletar recurso
kubectl delete deployment nginx
YAML Manifesto
In practice, you describe resources in YAML files and apply them with kubectl apply:
# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: minha-api
namespace: producao
spec:
replicas: 3
selector:
matchLabels:
app: minha-api
template:
metadata:
labels:
app: minha-api
spec:
containers:
- name: api
image: minha-api:1.2.0
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "256Mi"
cpu: "500m"
---
apiVersion: v1
kind: Service
metadata:
name: minha-api-svc
spec:
selector:
app: minha-api
ports:
- port: 80
targetPort: 8080
type: ClusterIP
kubectl apply -f deployment.yaml
kubectl get deployments -n producao
kubectl rollout status deployment/minha-api -n producao
CKA Certification
The CKA (Certified Kubernetes Administrator) is the most recognized Kubernetes certification. Unlike most exams, it is 100% hands-on: you get access to a real cluster and solve problems in 2 hours in the terminal.
What is covered in the CKA
- Cluster Architecture: understanding control plane components
- Workloads: Deployments, DaemonSets, StatefulSets, Jobs, CronJobs
- Networking: Services, Network Policies, Ingress, CoreDNS
- Storage: PersistentVolumes, PersistentVolumeClaims, StorageClasses
- Security: RBAC, ServiceAccounts, Secrets, SecurityContext
- Troubleshooting: diagnosing pods with crash, NotReady nodes, network failure
How to study for the CKA
- Practice in the terminal — the exam has no multiple choice
- Master
kubectlwith the--dry-run=client -o yamlflag to generate manifests quickly - Know kubernetes.io/docs — you can use it during the exam
- Use Killer.sh (official simulator, harder than the real exam, on purpose)
- Set up a local cluster with
kindorminikubeto practice daily
Getting Started Locally
# Instalar minikube (cluster local de 1 node)
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
# Iniciar cluster
minikube start
# kubectl já vem configurado para o minikube
kubectl get nodes
That was just one piece. The course teaches the whole path — from your first command to exam day.