ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 30 - 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: label contraints

A.

Yes

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: A

Explanation:

Label constraints can be used to schedule containers to meet the security policy requirements.Label constraints allow you to specify which nodes a service can run on based on the labels assigned to the nodes1. For example, you can label the nodes that are intended for development withenv=devand the nodes that are intended for production withenv=prod. Then, you can use the--constraintflag when creating a service to restrict it to run only on nodes with a certain label value.For example,docker service create --name dev-app --constraint 'node.labels.env == dev' ...will create a service that runs only on development nodes2.Similarly,docker service create --name prod-app --constraint 'node.labels.env == prod' ...will create a service that runs only on production nodes3. This way, you can ensure that development and production containers are running on separate nodes in a given Swarm cluster.Reference:

Add labels to swarm nodes

Using placement constraints with Docker Swarm

Multiple label placement constraints in docker swarm

asked 08/11/2024
Richard Drayer Camacho
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first