Bird
0
0

Given a pod with an ambassador container forwarding port 3306 to a MySQL container, what will be the output of connecting to 'localhost:3306' inside the ambassador container?

medium📝 Command Output Q4 of 15
Docker - Production Patterns
Given a pod with an ambassador container forwarding port 3306 to a MySQL container, what will be the output of connecting to 'localhost:3306' inside the ambassador container?
AMySQL server version info printed locally
BConnection refused error
CConnection to MySQL server succeeds
DTimeout error
Step-by-Step Solution
Solution:
  1. Step 1: Understand ambassador forwarding behavior

    The ambassador container listens on localhost:3306 and forwards requests to the MySQL container.
  2. Step 2: Predict connection result inside ambassador

    Connecting to localhost:3306 inside ambassador reaches MySQL, so connection succeeds.
  3. Final Answer:

    Connection to MySQL server succeeds -> Option C
  4. Quick Check:

    Ambassador localhost connection = success [OK]
Quick Trick: Inside ambassador, localhost forwards to target container [OK]
Common Mistakes:
  • Expecting connection refused due to wrong port
  • Assuming timeout without forwarding
  • Thinking ambassador prints MySQL info locally

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes