CoolFace
Apppublic

arimatch1/cka-kubernetes-practice

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
0likes
App README

☸️ CKA Kubernetes Practice Cluster

A fully browser-accessible, single-node Kubernetes cluster for CKA exam preparation. No local setup required. Click the app tab and a live terminal opens with kubectl ready.

How to Use

  1. 1.Open the Space and click the "App" tab
  2. 2.A browser terminal will open — Kubernetes is already running
  3. 3.Type practice-help to see all loaded scenarios
  4. 4.Use kubectl (or alias k) to complete practice tasks

Loaded Scenario Namespaces

NamespaceContents
practice-podsBasic pods including a broken ImagePullBackOff pod
practice-deploymentsDeployments with resource limits, services, rollout practice
practice-rbacServiceAccounts, Roles, RoleBindings, ClusterRoles
practice-netpolFrontend/Backend/Database tiers with NetworkPolicies
practice-storagePVs, PVCs, StorageClass, mounted storage pod
practice-troubleshootIntentionally broken resources for debugging practice

Practice Tasks by CKA Domain

Workloads & Scheduling (15%)

  • Scale webapp deployment in practice-deployments to 5 replicas
  • Upgrade old-app from nginx:1.16 to nginx:1.21 and then rollback
  • Taint the node with env=prod:NoSchedule, then create a pod with a matching toleration
  • Create a pod with nodeAffinity requiring label disktype=ssd
  • Create a pod in practice-pods with resource requests of cpu:250m, memory:64Mi

Application Lifecycle Management

  • Edit api-server deployment to add a ConfigMap as an environment variable
  • Create a new Secret and mount it as a volume in a pod
  • Add an initContainer to webapp that runs echo "init done" before the main container
  • Create a multi-container pod with a sidecar that shares a volume with the main container

Security (from 25% cluster config domain)

  • Run kubectl auth can-i list pods --as=system:serviceaccount:practice-rbac:dev-sa
  • Create a pod in practice-rbac namespace that uses readonly-sa as its service account
  • Create a new Role that allows only get on ConfigMaps and bind it to readonly-sa
  • Write a NetworkPolicy in practice-netpol that additionally blocks all egress from database

Services & Networking (20%)

  • Exec into frontend pod and test curl to backend service — should succeed
  • Exec into frontend pod and test curl to database service — should fail (NetworkPolicy)
  • Create an Ingress resource routing /app to webapp-svc on port 80
  • Find the ClusterIP of webapp-svc and curl it from within a busybox pod

Storage (10%)

  • Create a new PVC requesting 500Mi RWO and mount it to a new pod at /mnt/data
  • Write a file into the mounted path and verify it persists after pod restart
  • List all PVs and identify which reclaim policy each uses
  • Delete pvc-app and observe what happens to the bound PV

Troubleshooting (30%)

  • Fix every broken resource in practice-troubleshoot namespace
  • Identify why crashloop-pod is failing and correct it
  • Find out why pending-pod will never schedule and resolve it
  • Debug broken-svc and explain why it has no endpoints
  • Check kubelet logs: journalctl -u k3s -n 50
  • Get all events sorted by time: kubectl get events --sort-by=.metadata.creationTimestamp -A

Cluster Maintenance

  • Backup etcd: ETCDCTL_API=3 etcdctl snapshot save /tmp/etcd-backup.db
  • Drain the node (will reschedule everything): kubectl drain <node> --ignore-daemonsets
  • Uncordon the node after drain
  • Upgrade kubectl to a newer patch version

Limitations

  • Single-node K3s cluster (no multi-node scheduling scenarios)
  • No persistent storage across Space restarts
  • Free tier: 2 vCPUs, 16GB RAM — sufficient for all practice scenarios
  • K3s replaces full kubeadm setup but is functionally identical for CKA tasks

Resources