0
0
Microservicessystem_design~10 mins

Blue-green deployment in Microservices - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to identify the two environments used in blue-green deployment.

Microservices
environments = ['[1]', 'green']
Drag options to blanks, or click blank then click option'
Ayellow
Bred
Cblue
Dpurple
Attempts:
3 left
💡 Hint
Common Mistakes
Using colors other than blue for the first environment.
2fill in blank
medium

Complete the code to switch traffic to the new environment in blue-green deployment.

Microservices
current_live_env = '[1]'
Drag options to blanks, or click blank then click option'
Agreen
Bblue
Cred
Dyellow
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing the live environment with the inactive one.
3fill in blank
hard

Fix the error in the code that updates the live environment after deployment.

Microservices
live_env = '[1]'  # Should be the environment receiving traffic
Drag options to blanks, or click blank then click option'
Ablue
Bred
Cyellow
Dgreen
Attempts:
3 left
💡 Hint
Common Mistakes
Setting live environment to the old inactive environment.
4fill in blank
hard

Fill both blanks to create a dictionary mapping environments to their status.

Microservices
env_status = {'blue': '[1]', 'green': '[2]'}
Drag options to blanks, or click blank then click option'
Aactive
Binactive
Cpending
Dfailed
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up active and inactive statuses.
5fill in blank
hard

Fill all three blanks to complete the deployment switch logic.

Microservices
if current_env == '[1]':
    next_env = '[2]'
else:
    next_env = '[3]'
Drag options to blanks, or click blank then click option'
Ablue
Bgreen
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same environment for both next_env assignments.