Skip to content

Commit 8a01fd5

Browse files
committed
Merge branch '516-work' into ania-stage
2 parents 9b4f325 + d803dc7 commit 8a01fd5

2 files changed

Lines changed: 66 additions & 1 deletion

File tree

content/cumulus-linux-516/System-Configuration/Docker-with-Cumulus-Linux.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,71 @@ debug-mode False
421421
log-level json-file
422422
```
423423

424+
## Manage Docker Container Resources
425+
426+
By default, the switch restricts unknown containers to 20 percent of host resources and limited containers to 50 percent. You can customize these values by editing the `/etc/cumulus/docker/resources.conf` file.
427+
428+
```
429+
cumulus@switch: sudo nano /etc/cumulus/docker/resources.conf
430+
RESTRICTED_PERCENT=10 # Tighter jail for unknown apps
431+
LIMITED_PERCENT=60 # Slightly more room for limited apps
432+
```
433+
434+
After editing the `/etc/cumulus/docker/resources.conf` file, you must restart `cumulus-docker-resource-limit-calculator.service`.
435+
436+
```
437+
cumulus@switch: systemctl restart cumulus-docker-resource-limit-calculator.service
438+
```
439+
440+
The docker image whitelist maintains the list of trusted and limited images and is located in the `/etc/cumulus/docker/whitelist.json` file.
441+
442+
By default, the `/etc/cumulus/docker/whitelist.json` file ships with the following content.
443+
444+
```
445+
cumulus@switch: sudo cat /etc/cumulus/docker/whitelist.json
446+
{
447+
"trusted_images": [ ],
448+
"limited_images": ["docker-wjh"]
449+
}
450+
```
451+
452+
You can edit this file to add trusted and limited images.
453+
454+
```
455+
cumulus@switch: sudo nano /etc/cumulus/docker/whitelist.json
456+
{
457+
"trusted_images": [
458+
"internal-app",
459+
"postgres"
460+
],
461+
"limited_images": [
462+
"jenkins-agent",
463+
"python-worker"
464+
]
465+
}
466+
```
467+
468+
To show memory resource usage for containers, run the Linux `sudo cat /sys/fs/cgroup/cumulus-docker-trusted/memory.current` command.
469+
470+
```
471+
cumulus@switch: sudo cat /sys/fs/cgroup/cumulus-docker-trusted/memory.current
472+
473+
```
474+
475+
To show CPU resource usage for containers, run the Linux `sudo cat sys/fs/cgroup/cumulus-docker-trusted/cpu.stat` command and `sudo cat /sys/fs/cgroup/cumulus-docker-limited/cpu.stat` command.
476+
477+
```
478+
cumulus@switch: sudo cat /sys/fs/cgroup/cumulus-docker-limited/cpu.stat
479+
480+
```
481+
482+
To show which container processes are trusted and which are limited, run the `sudo cat /sys/fs/cgroup/cumulus-docker-trusted/cgroup.procs` command or the `sudo cat /sys/fs/cgroup/cumulus-docker-limited/cgroup.procs` command:
483+
484+
```
485+
cumulus@switch: sudo cat /sys/fs/cgroup/cumulus-docker-limited/cgroup.procs
486+
487+
```
488+
424489
## Considerations
425490

426491
- Be mindful of the types of applications you want to run in containers on a Cumulus Linux switch. Depending on the configuration of the container, DHCP servers, custom scripts, and other lightweight services run well. However, VPN, NAT and encryption-type services are CPU-intensive and lead to undesirable effects on critical applications.

content/cumulus-linux-516/Whats-New/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Cumulus Linux 5.16 contains new features and improvements, and provides bug fixe
3535
- {{<link url="802.1X-Interfaces/#preserve-dynamically-assigned-ipv6-addresses" text="802.1X preserve dynamically assigned IPv6 addresses">}}
3636
- {{<link url="Quality-of-Service/#shaping" text="PPS mode for QoS egress shapers">}}
3737
- {{<link url="Quality-of-Service/#extra-lossy-headroom" text="Extra threshold for QoS lossy priority groups">}}
38-
- Docker
38+
- {{<link url="Docker-with-Cumulus-Linux/#manage-docker-container-resources" text="Manage Docker container resources">}}
3939
- Health Event and SDK Driver Monitoring for Multi ASIC
4040
- Security features:
4141
- {{<link url="FIPS" text="FIPS mode">}}

0 commit comments

Comments
 (0)