Home

CKA Interactive Cram Guide

Search topics, expand sections, review commands, examples, and hands-on labs.

Cluster Architecture, Installation & Configuration
RBAC
Controls authorization in Kubernetes.
kubectl create role pod-reader --verb=get,list --resource=pods
kubectl create rolebinding read-pods --role=pod-reader --serviceaccount=default:sa
Exam Tip: Know Role vs ClusterRole and RoleBinding vs ClusterRoleBinding.
Kubeadm Installation
kubeadm init
mkdir -p $HOME/.kube
kubectl get nodes
Highly Available Cluster

Multiple control-plane nodes behind a load balancer with stacked or external etcd.

Upgrade Cluster
kubeadm upgrade plan
kubeadm upgrade apply vX.Y.Z
kubectl drain NODE --ignore-daemonsets
etcd Backup & Restore
ETCDCTL_API=3 etcdctl snapshot save backup.db
ETCDCTL_API=3 etcdctl snapshot restore backup.db

Hands-On Lab

  1. Create a namespace.
  2. Create a service account.
  3. Create Role and RoleBinding.
  4. Verify permissions with kubectl auth can-i.
Workloads & Scheduling
Deployments
kubectl create deployment nginx --image=nginx
kubectl rollout history deployment/nginx
kubectl rollout undo deployment/nginx
ConfigMaps
kubectl create configmap app-config --from-literal=color=blue
Secrets
kubectl create secret generic db-secret --from-literal=password=Pass123
Scaling
kubectl scale deployment nginx --replicas=5
Self-Healing

ReplicaSets recreate Pods. Liveness and Readiness probes detect problems.

Scheduling

Node selectors, taints/tolerations, affinity, anti-affinity.

Helm & Kustomize
helm install app chart/
kubectl apply -k overlays/prod

Lab

  1. Deploy nginx.
  2. Scale to 3 replicas.
  3. Update image.
  4. Rollback deployment.
Services & Networking
ClusterIP

Internal-only service.

NodePort

Exposes service on node port.

LoadBalancer

Cloud provider load balancer.

Ingress
kubectl get ingress
CoreDNS
nslookup kubernetes.default
CNI Plugins

Calico, Flannel, Cilium, Weave.

Troubleshooting Connectivity
kubectl exec pod1 -- ping pod2
kubectl exec pod1 -- nslookup service

Lab

  1. Create ClusterIP service.
  2. Expose deployment.
  3. Verify endpoints.
  4. Create Ingress.
Storage
Persistent Volumes

Storage resource in cluster.

Persistent Volume Claims

User request for storage.

Access Modes
  • RWO
  • ROX
  • RWX
Reclaim Policies
  • Retain
  • Delete
  • Recycle (legacy)
StorageClass

Dynamic provisioning.

Lab

  1. Create PVC.
  2. Mount into Pod.
  3. Write file and restart Pod.
  4. Verify persistence.
Troubleshooting
Logs
kubectl logs POD
kubectl logs POD -c container
Describe Resources
kubectl describe pod POD
Node Problems
journalctl -u kubelet
systemctl status kubelet
Control Plane
kubectl get pods -n kube-system
Monitoring
kubectl top node
kubectl top pod
Fast Exam Checklist
  • Check events
  • Check logs
  • Check describe output
  • Check endpoints
  • Check DNS
  • Check RBAC

Lab

  1. Create a broken deployment.
  2. Identify image error.
  3. Fix and verify readiness.
50 Command Cram Sheet
kubectl get pods -A
kubectl describe pod POD
kubectl logs POD
kubectl exec -it POD -- sh
kubectl get svc
kubectl get ingress
kubectl get pvc
kubectl get pv
kubectl get nodes
kubectl cordon NODE
kubectl drain NODE
kubectl uncordon NODE
kubectl rollout undo deployment/APP
kubectl scale deployment APP --replicas=5
kubectl auth can-i create pods
kubectl top nodes
kubectl top pods