DevOps & Kubernetes Fundamentals: CI/CD to Production Ops
System DesignModel answerLast updated
Demonstrate practical DevOps fluency across CI/CD pipelines, GitOps delivery, Kubernetes troubleshooting, containerization, and Linux diagnostics.
You are being evaluated for a production-focused engineering role that requires both conceptual understanding and hands-on operational skills. Answer each of the following questions concisely but precisely — give concrete examples, name tools you have actually used, and explain trade-offs where relevant.
-
Define CI/CD. Walk through the stages of a typical pipeline and name at least two tools, explaining why you would choose each.
-
Describe the GitOps workflow for deploying to Kubernetes using a pull-based CD tool. How does sync work? How do you handle rollbacks in a way that preserves Git as the source of truth?
-
What is Helm and what problem does it solve? Sketch the directory structure of a Helm chart and explain what each major file or folder does.
-
A pod running a Java application is stuck in
CrashLoopBackOff. Walk through your debugging process step by step, including specific commands and the most common root causes for a JDBC-based service. -
What is a VPC? What is HPC? When would each come up in a cloud or infrastructure conversation?
-
Give three concrete reasons to containerize an application. What are the main trade-offs?
-
You need to inspect a running process with PID
9003on a Linux host. What commands would you use, and what information does each give you? -
What Linux commands help you locate files or directories? Give at least three approaches and describe when you would use each.
-
What tools or commands have you used to diagnose network connectivity problems? Describe the kind of problem each one is best suited for.
-
How do you make database schema changes safer in a production environment? Address backward compatibility, rollbacks, and minimizing downtime.
-
Compare
DeploymentandStatefulSetin Kubernetes. What are the behavioral differences and when should you use each?
For each answer, aim to show that you understand why, not just what. Mention failure modes and edge cases where they are relevant.
Hints
Hint 1
For CI/CD, structure your answer as a pipeline: commit → build → test → scan → publish → deploy → verify. Name a specific tool for each phase if you can, and explain the choice rather than just listing names.
Hint 2
For the CrashLoopBackOff question, start by reading the exit code from `kubectl describe` before looking at logs — exit code 137 (OOMKilled) and exit code 1 (app error) point to completely different fixes.
Hint 3
For StatefulSet vs Deployment, anchor your answer in identity and storage: StatefulSets give each pod a stable hostname and its own PersistentVolumeClaim; Deployments treat pods as interchangeable. That single difference drives every other behavioral distinction.
Model answer
Medium Try it yourself first — then compare your approach, complexity and edge cases.
1. CI/CD Explained
CI (Continuous Integration) means every commit triggers an automated build, test, and artifact-production step. For containers, the artifact is an image tagged with the Git SHA. CD splits into two flavors: Continuous Delivery, where the artifact is always deployable but a human approves the production promotion, and Continuous Deployment, where promotion is fully automated.
A typical pipeline: checkout → lint/build → unit tests → SAST and dependency scan (e.g., Trivy, Snyk) → push image to registry → deploy to staging → integration/smoke tests → promote to production.
Tool choices matter:
| Tool | Why |
|---|---|
| GitHub Actions / GitLab CI | Pipeline-as-code lives next to the source; hosted runners; low operational overhead |
| Jenkins | Flexible plugin ecosystem; common in enterprises; higher maintenance cost |
| Tekton | Kubernetes-native; fits OpenShift environments |
| Argo CD | The CD half — pull-based GitOps; covered below |
Always explain why you picked a tool, not just that you used it.
2. GitOps Delivery with a Pull-Based CD Tool (e.g., Argo CD)
- CI builds and pushes
app:<git-sha>to a registry. - CI (or an image updater) commits the new tag to a separate config repo, e.g., updating
values-prod.yaml. - An
Applicationresource points to that config repo, a path, and a target cluster/namespace. - The CD tool continuously compares desired state (Git) with live state (cluster). A mismatch surfaces as OutOfSync.
- Sync applies the manifests. Automated sync (
syncPolicy.automated) can also prune removed resources and self-heal manual drift. - Sync hooks (
PreSync,PostSync) handle ordered operations like running a DB migration Job before the rollout.
Rollbacks: the GitOps-correct approach is git revert, keeping Git authoritative. A direct rollback command also exists but requires disabling auto-sync first or the tool will immediately re-sync to the current Git HEAD.
Why GitOps matters: audit trail via Git history, PR-based review, no cluster credentials in CI, and automatic drift detection.
3. Helm
Helm is a Kubernetes package manager. A chart is a set of Go-templated manifests. Helm renders templates with values (defaults in values.yaml, overridden by -f flags or --set), applies them as a versioned release, and stores revision history as Secrets in the namespace.
charts/myapp/
Chart.yaml # name, chart version, appVersion, dependencies
values.yaml # default values
values-staging.yaml # environment overrides
templates/
_helpers.tpl # reusable named templates (labels, fullname)
deployment.yaml
service.yaml
ingress.yaml
configmap.yaml
hpa.yaml
NOTES.txt # post-install instructions
charts/ # vendored subcharts
Key commands: helm upgrade --install (idempotent apply), helm rollback, helm template (render without applying), helm lint (validate before commit). CD tools like Argo CD can render Helm charts natively, so Helm and GitOps integrate cleanly.
4. Debugging CrashLoopBackOff (Java/JDBC)
Start structured, not random:
kubectl get pod <name> -o wide # restart count, node
kubectl describe pod <name> # Events, exit code, probe config
kubectl logs <name> --previous # logs of the crashed container
kubectl get events --sort-by=.lastTimestamp
Read the exit code first:
137/OOMKilled: JVM heap exceeds the container memory limit. Fix: set-XX:MaxRAMPercentage=75and right-size limits.1: application error. Read the stack trace.
Common JDBC-specific causes:
Connection refused/Communications link failure: wrong host/port, DB not ready, or a NetworkPolicy blocking the port.UnknownHostException: wrong Service name or DNS misconfiguration.Access denied: Secret not mounted, or env var name mismatch.- SSL/truststore errors.
- Driver jar missing from the image.
Probe pitfall: a liveness probe can kill a slow-starting JVM. Add a startupProbe or raise initialDelaySeconds.
Verify connectivity: kubectl exec into a debug pod and run nc -zv <db-host> 5432 and nslookup <db-host>. Check ConfigMap and Secret values directly.
5. VPC and HPC
VPC (Virtual Private Cloud): a logically isolated network inside a public cloud with subnets, route tables, security groups, internet gateways, and VPN or peering links. It is the standard network boundary for cloud workloads.
HPC (High-Performance Computing): tightly coupled compute clusters for simulation, scientific workloads, or large-scale ML training. They use parallel schedulers (Slurm, IBM Spectrum LSF), fast interconnects (InfiniBand), parallel filesystems, and MPI-style jobs.
If the interviewer says "HPA/VPA," clarify — those are Kubernetes autoscalers (Horizontal Pod Autoscaler scales replica count; Vertical Pod Autoscaler adjusts resource requests).
6. Why Containerize?
- Reproducibility: the same immutable image runs in every environment. "Works on my machine" is eliminated.
- Isolation and resource control: OS namespaces and cgroups separate processes and enforce CPU/memory limits.
- Operational leverage: containers unlock orchestration — rolling updates, self-healing, autoscaling, and multi-cloud portability.
Trade-offs to acknowledge: image layers need regular security patching; stateful data must live outside the container; adding a container runtime and orchestration layer increases operational complexity.
7. Inspecting PID 9003
ps -fp 9003 # owner, parent PID, start time, command
cat /proc/9003/status # state, memory, thread count
cat /proc/9003/cmdline | tr '\0' ' ' # full command line with arguments
ls -l /proc/9003/fd # open file descriptors
lsof -p 9003 # open files and sockets
ss -tulpnp | grep 9003 # listening/connected ports
top -p 9003 # live CPU and memory
strace -p 9003 # system calls (use briefly; has overhead)
jcmd 9003 Thread.print # thread dump if it is a JVM
8. Finding Files and Directories
find /var/log -name "*.log" -mtime -1 # by name pattern or modification time
find / -type f -size +100M # by type and size
locate nginx.conf # fast index-based search (db must be current)
which python3 / type python3 # locate executables on PATH
ls -la /etc/ # direct listing when path is known
grep -r "db_password" /etc/ # search by content, useful for config hunting
Use find for precise, real-time searches; locate for speed when you just updated the index; grep -r when you are searching by content rather than filename.
9. Network Diagnostics
| Tool | Best for |
|---|---|
ping | Basic reachability and latency |
traceroute / tracepath | Finding where packets stop in a path |
nslookup / dig | DNS resolution issues |
nc -zv <host> <port> | TCP port reachability (great inside pods) |
ss / netstat | Local socket state; what is listening |
curl -v / wget | HTTP-level debugging including headers and TLS |
tcpdump / Wireshark | Packet capture for deep inspection |
iperf3 | Bandwidth and throughput testing |
In a Kubernetes context, kubectl exec + nc or curl is the fastest first step because it tests connectivity from inside the same network namespace as the failing pod.
10. Safer Database Deployments
Schema changes:
- Use an expand-contract (or parallel-change) pattern: first add new columns as nullable, deploy the app that writes both old and new forms, then drop old columns in a later release. This keeps old and new code compatible simultaneously.
- Use a migration tool (Flyway, Liquibase) so migrations are versioned, repeatable, and tracked.
- Prefer additive changes (adding nullable columns, adding tables) over destructive ones.
Minimizing downtime:
- Run migrations as a pre-deployment step (Kubernetes
initContaineror a sync hook). - Use
pt-online-schema-changeorgh-ostfor large table alterations to avoid long locks.
Rollbacks:
- Always write a
downmigration alongside eachup. - Test rollback in staging — an untested rollback script is not a safety net.
11. StatefulSet vs Deployment
| Aspect | Deployment | StatefulSet |
|---|---|---|
| Pod identity | Pods are interchangeable; random names | Each pod has a stable ordinal name (app-0, app-1) |
| Storage | Shared or ephemeral volumes | Each pod gets its own PersistentVolumeClaim, retained on delete |
| Scaling order | Parallel by default | Ordered: scale up 0 → n, scale down n → 0 |
| Rolling updates | Surge-based, any order | Ordered, one at a time from highest ordinal |
| DNS | Single Service | Headless Service gives each pod a stable DNS entry (app-0.svc) |
Use a Deployment for stateless services (web servers, APIs, workers) where any replica can handle any request.
Use a StatefulSet when pods need stable identity or dedicated storage: databases (Postgres, Cassandra), Kafka brokers, Elasticsearch nodes, or any service where losing identity or mixing storage across pods would corrupt data.
A common mistake is trying to run a clustered database as a Deployment and discovering that pods end up sharing a PVC or losing their node identity after a rescheduling event.