summaryrefslogtreecommitdiff
path: root/interface-definitions/containers.xml.in
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-23 11:48:47 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-23 11:49:46 +0200
commite71a98562aabea53cb9b5e1958398e1e674490bb (patch)
tree80290698e506e92a69710bb7cea70d37fa2fc2ee /interface-definitions/containers.xml.in
parent1f6746c44c5349a35847abfb410d3826a4e7ca99 (diff)
downloadvyos-1x-e71a98562aabea53cb9b5e1958398e1e674490bb.tar.gz
vyos-1x-e71a98562aabea53cb9b5e1958398e1e674490bb.zip
containers: T2216: add CLI commands to specify restart behavior and memory usage
A container is limited to 256MB memory by default and will always restart on failure.
Diffstat (limited to 'interface-definitions/containers.xml.in')
-rw-r--r--interface-definitions/containers.xml.in42
1 files changed, 42 insertions, 0 deletions
diff --git a/interface-definitions/containers.xml.in b/interface-definitions/containers.xml.in
index 030980dba..419802866 100644
--- a/interface-definitions/containers.xml.in
+++ b/interface-definitions/containers.xml.in
@@ -47,6 +47,24 @@
<help>Image name in the hub-registry</help>
</properties>
</leafNode>
+ <leafNode name="memory">
+ <properties>
+ <help>Constrain the memory available to a container (default: 256MB)</help>
+ <valueHelp>
+ <format>u32:0</format>
+ <description>Unlimited</description>
+ </valueHelp>
+ <valueHelp>
+ <format>u32:1-16384</format>
+ <description>Container memory in megabytes (MB)</description>
+ </valueHelp>
+ <constraint>
+ <validator name="numeric" argument="--range 0-16384"/>
+ </constraint>
+ <constraintErrorMessage>Container memory must be in range 0 to 16384 MB</constraintErrorMessage>
+ </properties>
+ <defaultValue>256</defaultValue>
+ </leafNode>
<tagNode name="network">
<properties>
<help>Attach user defined network to container</help>
@@ -119,6 +137,30 @@
</leafNode>
</children>
</tagNode>
+ <leafNode name="restart">
+ <properties>
+ <help>Mount a volume into the container</help>
+ <completionHelp>
+ <list>no on-failure always</list>
+ </completionHelp>
+ <valueHelp>
+ <format>no</format>
+ <description>Do not restart containers on exit</description>
+ </valueHelp>
+ <valueHelp>
+ <format>on-failure</format>
+ <description>Restart containers when they exit with a non-zero exit code, retrying indefinitely (default)</description>
+ </valueHelp>
+ <valueHelp>
+ <format>always</format>
+ <description>Restart containers when they exit, regardless of status, retrying indefinitely</description>
+ </valueHelp>
+ <constraint>
+ <regex>^(no|on-failure|always)$</regex>
+ </constraint>
+ </properties>
+ <defaultValue>on-failure</defaultValue>
+ </leafNode>
<tagNode name="volume">
<properties>
<help>Mount a volume into the container</help>