ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 123 - DCA discussion

Report
Export

A company's security policy specifies that development and production containers must run on separate nodes in a given Swarm cluster. Can this be used to schedule containers to meet the security policy requirements?

Solution. environment variables

A.

Yes

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: B

Explanation:

Environment variables cannot be used to schedule containers to meet the security policy requirements.Environment variables are used to pass configuration data to the containers, not to control where they run1.To schedule containers to run on separate nodes in a Swarm cluster, you need to use node labels and service constraints23.Node labels are key-value pairs that you can assign to nodes to organize them into groups4. Service constraints are expressions that you can use to limit the nodes where a service can run based on the node labels. For example, you can label some nodes asenv=devand others asenv=prod, and then use the constraint--constraint node.labels.env==devor--constraint node.labels.env==prodwhen creating a service to ensure that it runs only on the nodes with the matching label.Reference:

1: Environment variables in Compose | Docker Docs

2: Deploy services to a swarm | Docker Docs

3: How to use Docker Swarm labels to deploy containers on specific nodes

4: Manage nodes in a swarm | Docker Docs

[5]: Swarm mode routing mesh | Docker Docs

[6]: Docker Swarm - How to set environment variables for tasks on various nodes

asked 08/11/2024
Solanki Narendra
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first