0
0
Dockerdevops~15 mins

Swarm vs Kubernetes decision in Docker - Hands-On Comparison

Choose your learning style9 modes available
Swarm vs Kubernetes Decision Helper
📖 Scenario: You are a DevOps engineer helping a small company decide which container orchestration tool to use: Docker Swarm or Kubernetes. You will create a simple program that stores key features of both tools, sets a decision threshold, compares the features, and outputs a recommendation.
🎯 Goal: Build a small program that holds feature data for Docker Swarm and Kubernetes, sets a threshold for decision making, compares the features, and prints a recommendation on which tool to choose based on the threshold.
📋 What You'll Learn
Create a dictionary called features with keys 'Swarm' and 'Kubernetes' and integer values representing feature scores
Create a variable called threshold set to 7
Use an if statement to compare the feature scores to the threshold
Print the recommendation exactly as specified
💡 Why This Matters
🌍 Real World
Companies often need to choose the right container orchestration tool based on their needs. This project simulates making that choice using simple data and logic.
💼 Career
DevOps engineers must understand differences between tools like Swarm and Kubernetes and be able to automate decisions and configurations.
Progress0 / 4 steps
1
Create the features dictionary
Create a dictionary called features with these exact entries: 'Swarm': 6 and 'Kubernetes': 9
Docker
Need a hint?

Use curly braces to create a dictionary with keys 'Swarm' and 'Kubernetes' and their scores as values.

2
Set the decision threshold
Create a variable called threshold and set it to the integer 7
Docker
Need a hint?

Just assign the number 7 to a variable named threshold.

3
Compare features to threshold
Write an if statement that checks if features['Kubernetes'] is greater than or equal to threshold. If true, assign the string 'Use Kubernetes' to a variable called decision. Otherwise, assign 'Use Swarm' to decision.
Docker
Need a hint?

Use an if-else block to compare the Kubernetes score with the threshold and assign the decision string accordingly.

4
Print the decision
Write a print statement to display the value of the variable decision
Docker
Need a hint?

Use print(decision) to show the recommendation.