A comprehensive quiz exploring the migration journey from Docker Compose setups to production-ready Kubernetes deployments in real-world application environments.
Which feature does Kubernetes provide that is not natively available in Docker Compose for managing containers at scale?
Explanation: Kubernetes automatically reschedules failed pods to maintain the desired state, improving resiliency in production. Docker Compose lacks built-in orchestration for automatic container recovery. Both tools allow multi-container definitions and basic environment variable injection, while simple network linking is available in both but not as advanced as Kubernetes' service discovery.
What is a key advantage of using Kubernetes Secrets compared to Docker Compose for sensitive configuration data?
Explanation: Kubernetes Secrets enable encrypted storage and distribution of sensitive data like passwords or tokens. Docker Compose typically relies on plain environment variables, lacking encryption. Automatic schema generation and image scanning are not roles for configuration storage, and conditional logic is handled elsewhere, not directly by Kubernetes Secrets.
In a production environment running databases, why is Kubernetes PersistentVolume important compared to standard Docker Compose volumes?
Explanation: Kubernetes PersistentVolumes provide infrastructure-agnostic, dynamically provisioned storage that survives pod restarts and migrations. Docker Compose volumes are simpler and often host-bound, risking data loss on host or container changes. The other options describe unrelated features such as image caching, network routing, or shared memory, which are not the core advantage here.
How does Kubernetes improve service discovery and routing over Docker Compose in complex applications?
Explanation: Kubernetes assigns DNS names to services and offers built-in load balancing for traffic distribution. Docker Compose supports service naming but lacks advanced DNS and load balancing capabilities. The other options describe limitations or incorrect behaviors not present in Kubernetes' networking model.
Which approach is recommended for automating deployment to Kubernetes, minimizing manual steps compared to Docker Compose workflows?
Explanation: Automated scripts and declarative YAML manifest files streamline and repeatably manage Kubernetes deployments, minimizing manual work. Manual editing, low-level runtime commands, and per-deployment interactive input are error-prone and not scalable, especially compared to declarative and automated approaches.