試験DCA トピック1 問題27 スレッド
Docker DCAのリアル試験問題集
問題 #: 27
トピック #: 1
問題 #: 27
トピック #: 1
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
Solution.environment variables
おすすめの解答: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 as env=dev and others as env=prod, and then use the constraint --constraint node.labels.env==dev or --constraint node.labels.env==prod when creating a service to ensure that it runs only on the nodes with the matching label. References:
* 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
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 as env=dev and others as env=prod, and then use the constraint --constraint node.labels.env==dev or --constraint node.labels.env==prod when creating a service to ensure that it runs only on the nodes with the matching label. References:
* 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
藤岛** 2024-02-18 01:52:45
コメント
他人の解答コメントを賛成するのも、その解答に一票を入れることになります。したがって、すでに同じ意見の投票コメントが存在する場合、新規コメントをする代わりに賛成することもできます。
コメントを通報する
コメント中
今すぐ 新規登録 / ログイン (無料です)。