Challenges & cheat sheets

Hands-on challenges to sharpen your skills and quick-reference cheat sheets for the tools you use every day.

ยง1Engineering challenges
01beginnerKubernetes

Debug a CrashLoopBackOff

A pod is stuck in CrashLoopBackOff. The container is running a Python Flask app on port 8080 but the Deployment specifies containerPort 80. Find and fix the issue.

Show hint โ†’
Check the Deployment spec and compare the containerPort with what the app actually listens on.
02intermediateTerraform

Fix a broken Terraform state

A team member manually deleted an S3 bucket that Terraform manages. Running terraform plan now shows it wants to create a new bucket with the same name. Fix the state without destroying other resources.

Show hint โ†’
Look at terraform state rm and terraform import โ€” one removes the broken reference, the other re-imports the real resource.
03intermediatePostgreSQL

Slow PostgreSQL query

A query joining users and orders is taking 2.3 seconds on a table with 500k rows. EXPLAIN shows a sequential scan on the orders table. The WHERE clause filters on created_at. Fix it.

Show hint โ†’
A well-chosen index on the filtered column transforms a sequential scan into an index scan.
04advancedKubernetes

Zero-downtime K8s upgrade

You need to upgrade an EKS cluster from 1.28 to 1.30 with zero downtime. There are 15 services running across 3 node groups. Describe your approach including pre-checks, node group rotation, and rollback plan.

Show hint โ†’
Think about PodDisruptionBudgets, node group versioning, and how to validate each step before proceeding.

More challenges coming weekly. Got one to suggest? Get in touch โ†’

ยง2kubectl cheat sheet
kubectl get pods -AList all pods in all namespaces
kubectl get pods -n <ns> -o widePods with node and IP info
kubectl describe pod <name>Detailed pod info and events
kubectl logs <pod> -fStream pod logs
kubectl logs <pod> -c <container>Logs from specific container
kubectl exec -it <pod> -- /bin/shShell into a running pod
kubectl apply -f <file>.yamlApply a manifest
kubectl delete -f <file>.yamlDelete resources from manifest
kubectl rollout status deploy/<name>Watch a rollout
kubectl rollout undo deploy/<name>Rollback a deployment
kubectl scale deploy/<name> --replicas=3Scale a deployment
kubectl top pods -ACPU and memory usage per pod
kubectl get events --sort-by=.lastTimestampRecent cluster events
kubectl port-forward svc/<svc> 8080:80Forward a service port locally
kubectl drain <node> --ignore-daemonsetsSafely drain a node
kubectl cordon <node>Mark node as unschedulable
kubectl get nodes -o wideNode list with IPs and roles
kubectl get secret <name> -o jsonpath='{.data.*}' | base64 -dDecode a secret value
ยง3Terraform cheat sheet
terraform initInitialize working directory
terraform planShow execution plan
terraform plan -out=tfplanSave plan to file
terraform apply tfplanApply a saved plan
terraform apply -auto-approveApply without confirmation
terraform destroyDestroy all managed infrastructure
terraform fmt -recursiveFormat all .tf files
terraform validateValidate configuration syntax
terraform state listList all resources in state
terraform state show <resource>Show details of a state resource
terraform state rm <resource>Remove resource from state (not cloud)
terraform import <resource> <id>Import existing resource into state
terraform outputShow output values
terraform workspace listList workspaces
terraform workspace new <name>Create a new workspace
terraform taint <resource>Mark resource for recreation
terraform graph | dot -Tpng > graph.pngVisualize dependency graph
ยง4AWS CLI cheat sheet
aws sts get-caller-identityShow current IAM identity
aws configure listShow active credentials and region
aws ec2 describe-instances --query "Reservations[].Instances[].[InstanceId,State.Name,Tags[?Key=='Name'].Value|[0]]" --output tableList EC2 instances as table
aws s3 ls s3://<bucket> --recursive --human-readableList S3 bucket contents
aws s3 sync ./local s3://<bucket>/Sync local folder to S3
aws eks update-kubeconfig --name <cluster> --region <region>Add EKS cluster to kubeconfig
aws logs tail <log-group> --followStream CloudWatch logs
aws ssm start-session --target <instance-id>SSM session without SSH
aws iam list-attached-user-policies --user-name <user>List policies for IAM user
aws secretsmanager get-secret-value --secret-id <name>Retrieve a secret
aws rds describe-db-instances --query "DBInstances[].[DBInstanceIdentifier,DBInstanceStatus]" --output tableList RDS instances
aws cloudformation describe-stacks --query "Stacks[].StackName"List CloudFormation stacks