Migrate from Docker Compose on a single VM to Kubernetes. What changes?
BeginnerScenarioMigrations
Answer
Situation read → Compose assumes one host; Kubernetes assumes pods can move anywhere at any time.
What I'd do →
- Translate services to Deployments and Services (Kompose can give a starting point, but hand-tune the result).
- Replace bind mounts and local volumes: config to ConfigMaps and Secrets, data to PersistentVolumes or, better, managed services (RDS instead of a Postgres container).
- Replace
depends_onwith readiness probes and retry logic in the app. - Add resource requests and limits, health probes, and multiple replicas.
- Ingress replaces published ports; set up TLS with cert-manager.
- Move logs to stdout and ship them with a node-level agent.
Why → Compose's implicit assumptions (shared disk, fixed IPs, startup order) break in Kubernetes.
Interview tip → "Don't migrate the database container, move it to a managed service" is the practical advice.
More on Migrations
Migrate an application from EC2 to EKS with zero downtime. Walk me through it.AdvancedMigrate a database from on-prem MySQL to Amazon RDS with minimal downtime. How?AdvancedYou need to move Terraform state from local files to an S3 backend. How?BeginnerMigrate CI from Jenkins to GitHub Actions for 80 repositories. How do you plan it?IntermediateUpgrade an EKS cluster from 1.30 to 1.31 in production. What's your process?IntermediateMove from a monolith to microservices. What's the DevOps side of the migration?Advanced