45 lines
1.2 KiB
Markdown
45 lines
1.2 KiB
Markdown
# Docker Swarm Node Labeling Guide
|
|
|
|
This guide provides the commands to apply the correct labels to your Docker Swarm nodes, ensuring that services are scheduled on the appropriate hardware.
|
|
|
|
Run the following commands in your terminal on a manager node to label each of your swarm nodes.
|
|
|
|
### 1. Label the Leader Node
|
|
This node will run general-purpose applications.
|
|
|
|
```bash
|
|
docker node update --label-add leader=true <node-name>
|
|
```
|
|
|
|
### 2. Label the Manager Node
|
|
This node will run core services like Traefik and Portainer.
|
|
|
|
```bash
|
|
docker node update --label-add manager=true <node-name>
|
|
```
|
|
|
|
### 3. Label the Heavy Worker Node
|
|
This node is for computationally intensive workloads like AI and machine learning.
|
|
|
|
```bash
|
|
docker node update --label-add heavy=true <node-name>
|
|
```
|
|
|
|
### 4. Label the Fedora Worker Node
|
|
This node is the primary heavy worker.
|
|
|
|
```bash
|
|
docker node update --label-add heavy=true fedora
|
|
```
|
|
|
|
## Verify Labels
|
|
|
|
After applying the labels, you can verify them by inspecting each node. For example, to check the labels for a node, run:
|
|
|
|
```bash
|
|
docker node inspect <node-name> --pretty
|
|
```
|
|
|
|
Look for the "Labels" section in the output to confirm the changes.
|
|
|