Tags: devops, ci-cd, docker, kubernetes, terraform, monitoring, gitops, bash
Level: intermediate
TL;DR: Core concepts, architectural patterns, and practical troubleshooting workflows required for technical DevOps interview stages.
CI/CD pipelines automate testing, linting, packaging, and deployments to achieve predictable delivery.
Infrastructure as Code (IaC) guarantees reproducible infrastructure states and eliminates manual drift.
Immutable infrastructure replaces server instances instead of modifying them in-place.
Blue-green and canary deployments minimize downtime and mitigate blast radius during releases.
Containers package dependencies with the application to ensure behavioral parity across environments.
Kubernetes decouples workloads using Pods, Deployments, and Services for orchestration and auto-healing.
GitOps utilizes Git repositories as the single source of truth for declared infrastructure and workload states.
Observability relies on three complementary pillars: metrics, distributed tracing, and structured logs.
The principle of least privilege ensures IAM roles provide only required permissions per service.
Disaster recovery designs balance Recovery Time Objective (RTO) against Recovery Point Objective (RPO).
Q: How do you approach zero-downtime deployment strategies?R: I leverage blue-green or canary rollouts using an ingress controller or service mesh, gradually shifting traffic while verifying health probes and error budgets.
Q: What is your process when a Kubernetes Pod is stuck in CrashLoopBackOff?R: I run kubectl describe pod to inspect events, check previous crash logs via kubectl logs --previous, and verify failing readiness/liveness probes or missing environment configs.
Q: How do you handle configuration drift in Terraform across environments?R: I enforce automated CI drift detection using terraform plan -detailed-exitcode and avoid ad-hoc cloud console changes by locking execution behind CI pipelines.
Q: How do you secure credentials inside CI/CD workflows?R: I avoid static credentials by integrating short-lived OIDC tokens directly with cloud providers and retrieving secrets at runtime via dedicated secret managers.
Q: What is the difference between horizontal and vertical scaling in production workloads?R: Horizontal scaling adds redundant compute nodes or pod replicas for resilience, whereas vertical scaling expands CPU or memory on existing instances.
Hardcoding credentials or API tokens directly into container images or pipeline configurations.
Missing resource requests and limits in Kubernetes manifests, leading to node memory exhaustion.
Overwriting existing Docker tags like :latest in production instead of using immutable commit SHAs.
Running containers as root inside production environments without dropping unnecessary capabilities.
Setting up alerting on noisy raw thresholds rather than actionable user-facing Service Level Objectives (SLOs).
# Debug a crashing Kubernetes pod
kubectl logs deploy/api-service --tail=100 -f --previous
kubectl describe pod -l app=api-service
# Inspect container exits and memory consumption
docker ps -a --filter "status=exited"
docker stats --no-stream
# Validate Terraform formatting and detect execution drift
terraform fmt -check -recursive
terraform plan -detailed-exitcode -out=tfplan
# Check TCP port connectivity and latency
nc -zv 10.0.1.50 443
curl -Iv --connect-timeout 5 https://internal.service.local/healthz
[ ] Kubernetes ingress controllers and cert-manager automated renewal
[ ] Terraform state locking mechanisms with Amazon S3 and DynamoDB
[ ] Prometheus PromQL queries and alerting threshold design
[ ] Linux system debugging using strace, journalctl, and netstat
[x] Docker multi-stage build optimization and caching strategies
[x] Git branching workflows, rebase rules, and semantic versioning
[x] Basic cloud IAM permission scoping and role assumption
Kubernetes Documentation: Workloads and Troubleshooting
Terraform by HashiCorp: State and Drift Management
Google Site Reliability Engineering: Eliminating Toil and Monitoring Distributed Systems