Docker - SwarmWhy does Docker swarm allow multiple replicas of a service to run on the same node when scaling?ATo maximize resource usage and ensure service availabilityBBecause Docker cannot detect node capacityCTo avoid network conflicts between containersDBecause replicas must always run on the same nodeCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand swarm scheduling goalsSwarm aims to use resources efficiently and keep services available.Step 2: Explain why multiple replicas run on one nodeRunning multiple replicas on one node maximizes resource use and maintains availability even with fewer nodes.Final Answer:To maximize resource usage and ensure service availability -> Option AQuick Check:Swarm schedules for resource use and availability [OK]Quick Trick: Swarm balances load and availability by replica placement [OK]Common Mistakes:Thinking Docker ignores node capacityBelieving replicas must be on separate nodesConfusing network conflicts with replica placement
Master "Swarm" in Docker9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Docker Quizzes Docker Security - Running containers as non-root - Quiz 13medium Docker Security - Running containers as non-root - Quiz 14medium Docker Swarm - Manager and worker nodes - Quiz 7medium Docker Swarm - Why orchestration matters - Quiz 3easy Docker in CI/CD - GitLab CI with Docker - Quiz 10hard Docker in CI/CD - Deploying from CI/CD pipeline - Quiz 11easy Docker in CI/CD - GitHub Actions with Docker - Quiz 9hard Image Optimization - Distroless images concept - Quiz 14medium Production Patterns - Blue-green deployment with containers - Quiz 12easy Resource Management - Resource monitoring per container - Quiz 1easy