Driver task.docker
Minimal configlet:
[task#1]
type = docker
image = ghcr.io/opensvc/pause
Minimal setup command:
om test/svc/foo set \
--kw="type=docker" \
--kw="image=ghcr.io/opensvc/pause"
Supported keywords:
- blocking_post_provision
- blocking_post_run
- blocking_post_stop
- blocking_post_unprovision
- blocking_pre_provision
- blocking_pre_run
- blocking_pre_stop
- blocking_pre_unprovision
- check
- command
- comment
- configs_environment
- confirmation
- cwd
- devices
- disable
- dns
- dns_search
- encap
- entrypoint
- environment
- guest_os
- hostname
- image
- image_pull_policy
- init
- install
- interactive
- ipcns
- limit_as
- limit_core
- limit_cpu
- limit_data
- limit_fsize
- limit_memlock
- limit_nofile
- limit_nproc
- limit_rss
- limit_stack
- limit_vmem
- log
- max_parallel
- monitor
- name
- net_rules
- netns
- on
- on_error
- optional
- osvc_root_path
- pace
- pg_blkio_weight
- pg_cpu_burst
- pg_cpu_quota
- pg_cpu_shares
- pg_cpus
- pg_mem_high
- pg_mem_limit
- pg_mem_oom_control
- pg_mem_swappiness
- pg_mems
- pg_pids_max
- pg_vmem_limit
- pidns
- post_provision
- post_run
- post_stop
- post_unprovision
- pre_provision
- pre_run
- pre_stop
- pre_unprovision
- privileged
- provision
- provision_requires
- pull_timeout
- read_only
- registry_creds
- retcodes
- rm
- run_args
- run_requires
- run_timeout
- schedule
- secrets_environment
- shared
- snooze
- standby
- stat_timeout
- stop_requires
- stop_timeout
- subset
- sysctl
- tags
- timeout
- tty
- type
- unprovision
- unprovision_requires
- user
- userns
- utsns
- volume_mounts
Keyword blocking_post_provision
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute after the resource provision action.
Errors interrupt the action.
This trigger is only executed on leaders.
Keyword blocking_post_run
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute after the resource run action.
Errors interrupt the action.
Keyword blocking_post_stop
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute after the resource stop action.
Errors interrupt the action.
Keyword blocking_post_unprovision
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute after the resource unprovision action.
Errors interrupt the action.
This trigger is only executed on leaders.
Keyword blocking_pre_provision
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute before the resource provision action.
Errors interrupt the action.
Keyword blocking_pre_run
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute before the resource run action.
Errors interrupt the action.
Keyword blocking_pre_stop
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute before the resource stop action.
Errors interrupt the action.
Keyword blocking_pre_unprovision
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute before the resource unprovision action.
Errors interrupt the action.
Keyword check
required: false
scopable: true
group: status
candidates: last_run, last_run_warn,
Example:
check=last_run
Description:
If set to last_run, the last run retcode is used to report a task resource
status.
If set to last_run_warn, the last run error retcode is displayed as a
resource warning.
If not set (default), the status of a task is always n/a.
Keyword command
required: false
scopable: true
group: process
aliases: run_command
convert: shlex
Example:
command=/opt/tomcat/bin/catalina.sh
Description:
The command to execute in the docker container on run.
Keyword comment
required: false
scopable: false
group: identity
Description:
A free form text describing the role of the object, of the node, or of the section it is set in.
The keyword is accepted in any section, so the DEFAULT section can document a configuration as a whole, and a resource, pool, heartbeat, array or network section can document itself.
The agent does not interpret the value.
Keyword configs_environment
required: false
scopable: true
group: environment
deprecated: since v3.0.0-rc57, replaced by environment
convert: shlex
Example:
configs_environment=PORT=http/port webapp/app1* {name}/* {name}-debug/settings
Description:
A whitespace-separated list of <var>=<cfg name>/<key path> or
<cfg name>/<key matcher>.
If the cfg or config key doesn’t exist then start and stop actions on
the resource will fail with a non 0 exit code.
A shell expression splitter is applied, so double quotes can be around
<cfg name>/<key path> only or whole <var>=<cfg name>/<key path>.
Example with,
-
<ns>/cfg/nginxa config having auserkey with valueuser1. -
<ns>/cfg/cfg1a config having akey1key with valueval1.
configs_environment = NGINX_USER=nginx/user cfg1/* creates the following
variables in the container command execution environment:
NGINX_USER=user1
key1=val1
Keyword confirmation
required: false
scopable: false
group: run
convert: bool
Description:
If set to true, ask for an interactive confirmation to run the task.
This flag can be used for dangerous tasks like data restoration.
Keyword cwd
required: false
scopable: true
group: process
Example:
cwd=/opt/foo
Description:
The current working directory set for the executed command.
Keyword devices
required: false
scopable: true
group: storage
convert: shlex
rbac: Host devices in container require the root grant.
Example:
devices=myvol1:/dev/xvda myvol2:/dev/xvdb
Description:
The whitespace-separated list of <host devpath>:<containerized devpath>
exposing host devices as container devices.
Keyword disable
required: false
scopable: true
group: availability
convert: bool
Description:
A disabled resource will be ignored on start, stop, provision and
unprovision actions.
A disabled resource status is n/a.
If set in the DEFAULT section of an object, the object is disabled and
ignores start, stop, shutdown, provision and unprovision actions.
These actions do nothing, and exit 7, a code telling the action was not
done because the instance is disabled, which the daemon takes as the end of
a stop and of an unprovision: a disabled object is purged. An unprovision
of a disabled instance whose resources are provisioned fails: the object
would be deleted with its storage left on the node. Enable it to
unprovision it.
om <path> disable sets DEFAULT.disable=true.
om <path> enable sets DEFAULT.disable=false.
Note: The
enableanddisableactions preserve the individual resourcedisablestate.
Keyword dns
required: false
scopable: true
group: network
convert: list
rbac: Requires the root grant.
Example:
dns=1.1.1.1 8.8.8.8
Description:
The whitespace-separated list of nameservers to add to the resolver of the container, after the nameservers of the cluster.
om writes the /etc/resolv.conf of the container itself and mounts it, so the
--dns argument of the container engine is not used and one set in run_args
is dropped.
A resolver reads the first three nameservers of a file and ignores the rest, so a cluster already naming three leaves no room here, and the ones dropped are named in a warning at start.
Keyword dns_search
required: false
scopable: true
group: network
convert: list
rbac: Requires the root grant.
Example:
dns_search=opensvc.com
Description:
The whitespace-separated list of DNS domains to search for shortname lookups.
If empty or not set, the list will be <name>.<namespace>.svc.<clustername> <namespace>.svc.<clustername> svc.<clustername>.
Keyword encap
required: false
scopable: false
group: encap
convert: bool
Description:
Set to true to ignore this resource in the nodes context and consider it in the encapnodes context. The resource is thus handled by agents deployed in the service containers.
Keyword entrypoint
required: false
scopable: true
group: process
convert: shlex
Example:
entrypoint=/bin/sh
Description:
The script or binary executed in the container.
The entrypoint args must be set in command.
Keyword environment
required: false
scopable: true
group: environment
convert: shlex
rbac: A server-local source uri requires the root grant.
Example:
environment=SLIP=slob OC3_DB_PASSWORD from ./sec/oc3 key db_password source random
Description:
A whitespace-separated list of variables: <var>=<value>, or
<var> from <path> key <key> [source <uri>] to read the value from the key of
a sec or a cfg.
A shell expression splitter is applied, so double quotes can be around
<value> only or whole <var>=<value>.
The path of a datastore is the one of an install line: ./sec/oc3 is the sec
named oc3 in the namespace of the object, other/cfg/oc3 a cfg of another
namespace, which has to allow it. A variable read from a sec is a secret.
A * in <var> stands for the key, and a key pattern names a variable per key
matching: * from ./sec/oc3 key db_* sets a variable named after each key
starting with db_, and OC3_* from ./cfg/oc3 key * one per key, prefixed with
OC3_.
source <uri> seeds the key when the datastore does not hold it, so a template
creates the secrets it reads:
source randomgenerates a password, once, at the provision of the object on its leader node, the datastore created in the namespace of the object if needed. The other nodes wait for it to reach them. A start, a task run or a provision not finding it fails, naming the key and the datastore: no node makes one of its own. An object whose resources have nothing to provision, as apps alone, is never provisioned, and its first start fails on the key missing: give it afs.flagresource, which the provision provisions.- an
http://orhttps://uri is fetched, as thenode.allowed_urlsand SSRF policies allow, at each provision and start of a node not finding the key. - any other uri is the path of a regular file of the node, read as the url is,
which requires the root grant.
/dev/urandomis such a path, and refused as no regular file:source randomis the generator.
A key the datastore holds is never written again, whatever the source, and an unprovision leaves it. A key two keywords of the object seed from two sources, and a key of a datastore of another namespace, are refused by the validation of the configuration.
A reference ends after its key, or after its source: a bare source variable
right after a reference is read as its source, so write it source= or before
the reference.
Example:
environment = SLIP=slob
OC3_DB_PASSWORD from ./sec/oc3 key db_password source random
OC3_FOO from ./cfg/oc3 key bar
A datastore or a key not existing is logged, and the variable not set, but a
key generated, source random, which is an error.
Keyword guest_os
required: false
scopable: true
group: guest
aliases: guestos
candidates: unix, windows
default: unix
Example:
guest_os=unix
Description:
The name of the operating system in the virtual machine.
Keyword hostname
required: false
scopable: true
group: identity
Example:
hostname=nginx1
Description:
Set the container hostname. If not set, a unique id is used.
Keyword image
required: true
scopable: true
group: image
aliases: run_image
rbac: An image starting with a '-' requires the root grant.
Example:
image=ghcr.io/opensvc/pause
Description:
The docker image pull, and run the container with.
Keyword image_pull_policy
required: false
scopable: true
group: image
candidates: once, always
Example:
image_pull_policy=once
Description:
The docker image pull policy.
-
alwaysPull upon each container start.
-
oncePull if not already pulled (default).
Keyword init
required: false
scopable: true
group: process
default: true
convert: bool
Description:
Run an init inside the container that forwards signals and reaps processes.
Keyword install
required: false
scopable: true
group: install
references: fs|volume rids
convert: list
Example:
install=fs#1
Description:
The volumes and filesystems whose files the task installs again before its
own work, as the install action does for them: fs#1 volume#data. A host
task installing files needs no command.
The files rendered from a template are rendered from what the node knows at
the time, and the install publishes a FileInstalled event for the ones it
wrote. With on, the files follow what the events say changed, and the
tasks on FileInstalled have what reads them read them again:
[task#refresh]
type = host
install = fs#1
on = NetworkPeersUpdated
[task#load_all]
type = host
container = container#swanctl
command = swanctl --load-all
on = FileInstalled,rid=fs#1
[fs#1]
install = /swanctl.conf from ./cfg/{name} key swanctl.conf template
The install takes the lock of the object, as the install action does. It writes only in the volumes and filesystems of the object, from the install lines they declare, so a task of any type may ask for it.
A failed install is a failed run, the task’s own work not done.
Keyword interactive
required: false
scopable: true
group: process
convert: bool
Description:
Keep stdin open even if not attached.
To use if the container entrypoint is a shell.
Keyword ipcns
required: false
scopable: true
group: isolation
candidates: , none, host, private, shareable
references: container rid
rbac: A namespace other than none or a container#<n> of the object requires the root grant.
Example:
ipcns=container#0
Description:
-
empty
The docker daemon’s default value is used.
-
none
Do not mount /dev/shm.
-
privateCreate a ipcns other containers can not share.
-
shareableCreate a ipcns other containers can share.
-
container#<i>Share the
container#<i>ipcns.
Keyword limit_as
required: false
scopable: true
group: limits
convert: size
Description:
The limit on the virtual memory, the address space, a process of the container can use (unit byte).
Same as limit_vmem: when both are set, the larger value is used.
The engine sets the soft and the hard limit to this value, as --ulimit as=<value>:<value>, which overrides its default ulimit and the --ulimit as
of run_args. Unset, the container runs with the default of the engine.
Keyword limit_core
required: false
scopable: true
group: limits
convert: size
rbac: The core dump and locked memory limits of a container require the root grant.
Description:
The limit on the size of the core dump a process of the container can produce (unit byte).
The engine sets the soft and the hard limit to this value, as --ulimit core=<value>:<value>, which overrides its default ulimit and the --ulimit core
of run_args. Unset, the container runs with the default of the engine.
Setting this keyword requires the root grant, where the other limit_*
keywords of a container are open to the administrator of the namespace.
Keyword limit_cpu
required: false
scopable: true
group: limits
convert: duration
Example:
limit_cpu=30s
Description:
The limit on the cpu time of a process of the container (duration, rounded down to the second).
The engine sets the soft and the hard limit to this value, as --ulimit cpu=<value>:<value>, which overrides its default ulimit and the --ulimit cpu
of run_args. Unset, the container runs with the default of the engine.
Keyword limit_data
required: false
scopable: true
group: limits
convert: size
Description:
The limit on the size of the data segment of a process of the container (unit byte).
The engine sets the soft and the hard limit to this value, as --ulimit data=<value>:<value>, which overrides its default ulimit and the --ulimit data
of run_args. Unset, the container runs with the default of the engine.
Keyword limit_fsize
required: false
scopable: true
group: limits
convert: size
Description:
The limit on the size of the files a process of the container can create (unit byte).
The engine sets the soft and the hard limit to this value, as --ulimit fsize=<value>:<value>, which overrides its default ulimit and the --ulimit fsize
of run_args. Unset, the container runs with the default of the engine.
Keyword limit_memlock
required: false
scopable: true
group: limits
convert: size
rbac: The core dump and locked memory limits of a container require the root grant.
Description:
The limit on how much memory a process of the container can lock with mlock(2) (unit byte).
The engine sets the soft and the hard limit to this value, as --ulimit memlock=<value>:<value>, which overrides its default ulimit and the --ulimit memlock
of run_args. Unset, the container runs with the default of the engine.
Setting this keyword requires the root grant, where the other limit_*
keywords of a container are open to the administrator of the namespace.
Keyword limit_nofile
required: false
scopable: true
group: limits
convert: size
Description:
The limit on the number of files a process of the container can have open at once.
The engine sets the soft and the hard limit to this value, as --ulimit nofile=<value>:<value>, which overrides its default ulimit and the --ulimit nofile
of run_args. Unset, the container runs with the default of the engine.
Keyword limit_nproc
required: false
scopable: true
group: limits
convert: size
Description:
The limit on the number of processes the user of a process of the container can have at one time. The kernel counts the processes of the user on the whole node, not in the container.
The engine sets the soft and the hard limit to this value, as --ulimit nproc=<value>:<value>, which overrides its default ulimit and the --ulimit nproc
of run_args. Unset, the container runs with the default of the engine.
Keyword limit_rss
required: false
scopable: true
group: limits
convert: size
Description:
The limit on the physical memory a process of the container can use (unit byte).
The Linux kernel does not enforce it: cap the memory of the container with pg_mem_limit.
The engine sets the soft and the hard limit to this value, as --ulimit rss=<value>:<value>, which overrides its default ulimit and the --ulimit rss
of run_args. Unset, the container runs with the default of the engine.
Keyword limit_stack
required: false
scopable: true
group: limits
convert: size
Description:
The limit on the size of the stack of a process of the container (unit byte).
The engine sets the soft and the hard limit to this value, as --ulimit stack=<value>:<value>, which overrides its default ulimit and the --ulimit stack
of run_args. Unset, the container runs with the default of the engine.
Keyword limit_vmem
required: false
scopable: true
group: limits
convert: size
Description:
The limit on the virtual memory, the address space, a process of the container can use (unit byte).
Same as limit_as: when both are set, the larger value is used.
The engine sets the soft and the hard limit to this value, as --ulimit as=<value>:<value>, which overrides its default ulimit and the --ulimit as
of run_args. Unset, the container runs with the default of the engine.
Keyword log
required: false
scopable: true
group: run
default: false
convert: bool
Description:
Log the task outputs in the object logs, and log its scheduled runs as a run asked by a user is.
The daemon scheduler logs the runs of the jobs it starts only when they ask
it, so a scheduled run of a task with log = false leaves no trace in the
journal but its status and its exit code.
Keyword max_parallel
required: false
scopable: true
group: run
default: 1
convert: int
Example:
max_parallel=2
Description:
Support limited, concurrent runs of tasks.
The task#xx.max_parallel=2 setting limits the number of concurrent task runs to 2.
The default value is 1, ensuring backward compatibility.
The run count is determined based on PID files created in the <resource var>/run/ directories.
The PID file is normally removed when the task execution ends, but if the executor dies abruptly (e.g., due to a SIGKILL), the stale PID file is not considered when computing the resource status. It is removed before the count check of the next run.
Staleness is evaluated using the condition: (PID file mtime < process birth time).
A new status log message may appear to indicate that the maximum concurrency limit has been reached.
Keyword monitor
required: false
scopable: true
group: monitoring
convert: bool
Description:
A resource with monitor=true will trigger the monitor_action
(crash or reboot the node, freezestop or switch the service) if:
-
The resource is
down. -
The instance has
local_expect=startedin its daemon monitor data, which means the daemon considers this instance is and should remain started. -
All restart tentatives failed.
Keyword name
required: false
scopable: true
group: identity
rbac: A container name of the user's choosing requires the root grant: the default name is the object's own.
Default:
Autogenerated using a <namespace>..<object name>.container.<resource index>
template.
Example:
name=osvcprd..rundeck.container.db
Description:
The name to assign to the container on docker run.
If not set, a <namespace>..<name>.container.<rid idx> name is automatically
assigned.
Keyword net_rules
required: false
scopable: true
group: isolation
rbac: A rule naming an object of another namespace than the one of the object, or another namespace, requires the guest, operator or admin grant on that namespace, or the root grant, a rule reading its addresses from a datastore of another namespace than the one of the object requires the datastore to share its keys with the namespace of the object, by its share keyword, and a rule reading its addresses from a datastore named by a reference that does not evaluate requires the root grant.
Example:
net_rules=allow namespace . allow dns deny cluster deny network lan allow any
Description:
The rules saying what the resource may exchange network packets with, and
what it may not, in both directions. One rule per line: allow or deny,
a noun, then what qualifies the noun:
net_rules =
allow node n2
deny network backend node n3
allow network backend
allow object ./svc/db
allow object ./svc/{name}-db rid ip#1
allow namespace .
deny address 192.168.10.5
allow address 192.168.10.0/24
allow address fd00:10::5
allow address from ./cfg/acl key allowed
allow object ./svc/db port 5432 proto tcp
The rules are an ordered list, and the first one matching a packet decides
of it, from the top: a packet from or to an address an allow rule names
passes, one from or to an address a deny rule names is dropped, and the
rules after the one that matched are not read. So an exception is written
before the rule it is carved out of: deny network backend node n3 before
allow network backend allows the network but the part of the node n3, and
written after it would decide of nothing.
Every list ends with three rules nobody writes, in this order:
allow localhost
allow dns
deny any
What no rule matches is denied: a list says what is let through, and a list
with no allow rule lets through the loopback addresses and the nameservers
alone, which the validation warns of. A last allow any turns it around:
the list then says what is denied, and the rest passes.
localhost and dns are allowed without a rule saying so: a filter written
for the peers of an application is not meant to cut it from its own node,
nor from the names it resolves. They come last, just before the deny any,
so a written rule matching them wins: deny localhost or deny dns takes
them away, and so does a deny of what holds them, as deny cluster where
the nameservers are the ones of cluster.dns, addresses of the cluster
nodes, unless allow dns is written before it. The node itself is reached
over the loopback addresses only: its other addresses, as the one its om
listener is on, need a node or cluster rule. The om socket, a file, is
not filtered. deny any alone cuts the resource from the network, its own
node included.
No rule, the keyword unset or empty, is no filter at all.
A service with an address on the lan network, reaching the objects of its
namespace, the nameservers and the world, and nothing else of the cluster,
its nodes and its networks:
net_rules =
allow namespace .
allow dns
deny cluster
deny network lan
allow any
The nouns:
localhost: the loopback addresses,127.0.0.0/8and::1.dns: the nameservers what the resource runs resolves through, see below.any: every address.address <address or range>: an ipv4 or ipv6 address, or a range.address from <datastore> key <key>: the addresses and ranges a key of a cfg or a sec holds, one per line, as./cfg/aclor./sec/acl, of the namespace of this object or of a datastore another namespace shares with it, see below.network <name>: the range of a cluster network. Followed bynode <nodename>, the part of it that node hands out.node <nodename>: a cluster node, the address of its listener and the ones its name resolves to.cluster: every cluster node.object <path>: the addresses the resources of an object publish in their status, as its ip resources, the instances of all the nodes together../svc/dbis the object of the namespace of this one,prod/svc/dbone of another namespace, and{name}and{namespace}are expanded. Followed byrid <resource id>, the addresses of that resource alone.namespace <name>: the addresses of every object of a namespace,.being the one of this object.
Any rule may end with port <port> proto tcp|udp, or port <first>-<last> proto tcp|udp, on a kvm container, see below: it then names that port of
what it names, and no other.
A value written on one line holds several rules, as a command sets it: a
verb starts a rule where the one before it is complete, so allow network backend allow node n2 is two rules, and allow network backend node n2
one, the part of the network the node hands out. A rule has one verb and
one noun: allow node n1 node n2 is refused, the verb being written again
for each.
om <path> config update --set 'container#1.net_rules=allow namespace . deny cluster allow any'
A rule added with net_rules+= is added after the others, so after a last
allow any, where it decides of nothing: the validation warns of it. The
order being what the rules mean, a list is changed by writing its value
again, whole, or by editing the configuration.
The validation warns of a rule that can never match, a rule before it
matching all it names whatever the cluster holds: any rule after an allow any or a deny any, a node after cluster, an object after its
namespace, a network narrowed to a node after the network, an address
after a range holding it, a rule written twice. It judges the rules as
written, and resolves nothing: two rules resolving to the same addresses on
this cluster are not warned of. These are warnings: the configuration is
committed, and the filter is the one of the rules as written.
dns, written or allowed without a rule, is the nameservers of the
resolver of what is filtered, and no other:
- An app, and a task running a command on the node: the nameservers the
/etc/resolv.confof the node names. Where it names a local stub, as the127.0.0.53of systemd-resolved, the command talks to the stub alone, and the servers the stub forwards to, the ones ofcluster.dnsamong them, are not opened. - A docker or podman container, and a task running one: the nameservers om
writes in the
/etc/resolv.confof the container, which are the ones of thednskeyword of the networks its addresses are on, else the ones ofcluster.dns, then the ones itsdnskeyword adds, the first three, as many as a resolver reads. A container om writes no resolver for, no nameserver being named, keeps the one of its engine: the nameservers the/etc/resolv.confof the node names are allowed. - A lxc container: the nameservers the
/etc/resolv.confof the node names, om writing no resolver for it. A container resolving through others, as the ones its own/etc/resolv.confnames, needs a rule naming them. - A kvm container: the nameservers of the
dnskeyword of the networks itsnetworkkeyword names, which om tells the guest. A guest told none resolves through what it is configured with, which om does not know: no nameserver is allowed without a rule naming it.
The nameservers of a docker, podman or kvm container are the ones it was
told at its start, which it keeps while it runs: the dns keyword of its
networks changed since, its status warns, the filter allows the ones of the
start until the resource restarts, and a rule allow address <nameserver>
allows a new one meanwhile, applied with no restart.
A nameserver allowed is reached on every port. The nameservers of
cluster.dns are addresses of the cluster nodes, so a container resolving
through them reaches whatever these nodes serve. Naming
in the dns keyword of a network an address dedicated to the dns on that
network opens that address alone to the containers of the network. An
address that is also one of a node, where services are bound to every
address, still reaches them.
A rule naming a network, a node, an object, a resource or a namespace the
cluster does not have, or an object not started yet, resolves to nothing,
and matches nothing until what it names exists: an allow rule lets
nothing more through, and a deny rule denies nothing, leaving the packets
to the rules after it. The validation of the
configuration warns of what does not exist, naming the object as resolved,
./svc/db being test/svc/db in the test namespace. It says nothing of
the objects of another namespace: the logs of the start do.
The rules are resolved when the resource starts: the networks and the nodes
from the configuration of the node, the objects from the daemon. With the
daemon down, the resource starts all the same, its object and namespace
rules resolving to nothing, with a warning, until the daemon is back.
The daemon then keeps the filter of the running resource current. When an object named starts, stops, moves or changes address, when an object joins or leaves a namespace named, when a node joins or a network changes, it resolves the rules again and sets the filter, which applies at once to what the resource runs, without a restart. An address every instance of an object publishes, as a failover address, is the same wherever the object runs: its failover changes nothing. A daemon starting sets the filters again.
The filter fails closed, on the side letting less through when the daemon does not know:
- An address of an
allowrule is taken away when the status of its object no longer publishes it, or the object is deleted. An address drawn from a network is released when its resource stops, where an address the configuration names is published started or not. It is kept while that status is not known, the daemon of a node of the object being down or restarting, which stops nothing of what the object runs. The delete of the object takes it away at once, a node of the object being down or not: a node back without the object says nothing of it. - An address of a
denyrule stays denied when its object stops publishing it, as what answers there may still be the object, until the object is deleted. - Either is forgotten as soon as another object publishes the address.
An address kept is kept by the rule that resolved to it, at the place of
that rule in the list and on its ports: an object named by an allow rule
and by a deny rule has its addresses followed by each, and one a deny
rule keeps is still denied before the rules written after it.
A change of the rules themselves, of net_rules, their order included, is
applied by the daemon to the resource as it runs, on the node running it, within
seconds and without a restart: the one change of the configuration it
applies with no action asked, a filter being a security setting. Rules
tightened, loosened or removed are set as the configuration is written, and
a daemon starting applies the ones changed while it was down. Rules the
validation refuses change nothing: the filter in force is kept, and the
status of the resource warns until they are fixed.
Rules given to a resource running with none are set under it when what it
runs is in a systemd unit of its slice: a container, and an app started
with systemd_properties. The start command of an app started with neither
rules nor systemd_properties runs in no unit, where nothing is filtered:
the rules apply at its next start, and its status warns until then. So do
the rules given to a container its start would have been refused with, as
one whose engine places it with the cgroupfs driver, and to a lxc container
started by an agent that made no scope of it, before its upgrade. A run of a task in
progress is given the rules as a running app or container is.
The status of the resource shows the filter in force: what each rule resolves to, in the order of the rules, the implicit ones included, up to the rule matching every address, which ends the list. The addresses of the rules naming another namespace are counted there, not listed.
The key of an address from <datastore> key <key> rule holds one address
or range per line, ipv4 or ipv6. An empty line, and a line starting with
#, is skipped. A line that is neither is left out, the others applying,
and warned of by the validation and by the start, by its number, and by its
text for a cfg. The datastore is one of the namespace of the object, ./
or the namespace spelled out, or one of another namespace sharing its keys
with it, as infra/cfg/acl with share = <namespace> or share = *, the
keys a resource installs being read the same way: the share keyword is
the consent of who administers the datastore, and no grant on its namespace
is asked of who writes the rule. A rule naming a datastore of another
namespace that does not share its keys is an error of the validation, for
root too, and resolves to nothing, in an allow rule and in a deny rule
alike.
A datastore or a key that does not exist resolves to nothing too, with a
warning, until it does.
The key is read when the resource starts, on its node, and the daemon keeps
the filter current: a key added, changed or removed, as by om <datastore> key change, changes the configuration of the datastore, and the daemon of
the node resolves the rules reading it again when it has it, and sets the
filter under the running resource, with no restart. A line removed is an
address taken away at once. The share keyword is read with the key, each
time: a datastore that stops sharing its keys with the namespace of the
object has its addresses taken out of the running filters, the daemon
warning of it, as if its key was removed.
The key of a sec is read by om, as root on the node, as the keys a resource
installs are. Its addresses are in the filter, and not in the status of the
resource, which counts them as it counts the ones of the rules naming
another namespace: who reads the status of a resource does not read the
keys of a sec. The addresses of a cfg are shown, its keys being read by who
reads its namespace, and the ones of a cfg of another namespace too, its
share keyword having given them to the namespace of the object. The logs
of the daemon, root’s, show the whole filter.
The filter of an app, a task and a docker, podman or lxc container knows
no port: a rule with a port qualifier is refused there, by the validation
and at the start, and only a kvm container takes it.
A port is the one of what the rule names, not one of the guest: allow object ./svc/db port 5432 proto tcp lets the guest talk to the port 5432 of
the addresses of the object, from any port of its own, and deny any port 25 proto tcp, written first, keeps it from every smtp server, the ones the
rules after it open whole included. The filter follows no
connection: a packet sent to the address passes by its destination port,
and one received from it by its source port. A guest serving a port to
clients is opened to them by a rule with no port. The other protocols of an
address opened on a port only, as the icmp of a ping, do not pass. The
first rule matching decides there too: a rule on a port matches the packets
of that port alone, and leaves the others to the rules after it.
The filter of an app, a task and a docker, podman or lxc container is the
IPAddressAllow and IPAddressDeny of the systemd slice of the process
group of the resource, enforced by the kernel on its cgroup, whatever
network namespace its processes are in. systemd knows no order, an allowed
range winning over a denied one: it is given the two lists letting through
exactly what the ordered rules do, each allow rule less what the deny
rules before it name, so systemctl show tells ranges carved around the
exceptions, where the status of the resource tells the rules in their
order. A list may be thousands of ranges, as a wide range allowed after
tens of ipv6 addresses denied one by one inside it, each carving it in up
to 128 ranges: a last allow any carves nothing, the addresses denied
before it being the denied list as they are. A filter systemd does not
take, as when it can not be reached, is an error: the start fails, and a
running resource keeps the filter in force, the daemon logging the error.
It needs systemd, the
unified cgroup hierarchy and a kernel attaching BPF programs to the cgroups:
the resource refuses to start where one is missing, rather than run
unfiltered, and so does a rootless container, whose group is delegated to
the systemd instance of a user. The IPAddressAllow and IPAddressDeny of
systemd_properties are still taken, and a packet passes when both let it.
What is filtered:
- An app, and a task running a command on the node: the start command, or
the run command, run in a transient systemd service unit of the slice, as
with
systemd_properties. The check, info, stop, quiesce and resume commands run outside the unit, and are not filtered. - A docker or podman container, and a task running one: the container, which
the engine places in a scope of the slice with its systemd cgroup driver.
With the cgroupfs driver the container is in no unit, and the resource
refuses to start. A
--restartoption inrun_argsis refused too: om passes none and restarts the containers itself, the filter set first, where the engine would restart one unfiltered, at boot or when it exits. So is a--cgroup-parentor a--cgroupsoption inrun_args, read after the placement of om: the engine would place the container out of the slice, unfiltered, which nothing verifies of a container run in the foreground, as the one of a task. - A lxc container: the container and its monitor, which om starts in a
transient systemd scope of the slice,
<slice>-lxc.scope, lxc making its groups under the one of the scope. Every lxc container is started so, with rules or not, on a node running systemd on the unified cgroup hierarchy, so rules given later apply at once. The commandslxc-attachruns in the container join its group, and are filtered. A lxc taking nolxc.cgroup.dir, 2.1 or older, places the container out of the scope: with rules, the resource refuses to start. - A kvm container: what the guest sends and what is sent to it, through
the interfaces om makes for the networks of its
networkkeyword. The filter is a nftables table of thenetdevfamily by interface, namedosvc_netwarden_<interface>: a pair of sets by rule, holding the addresses it resolves to, and two chains reading them in the order of the rules, a line by rule. It is loaded before the interface is plugged, and after the rules ofnetwork_filter, which keep the guest to its own addresses. Under the running guest, the addresses moving replace the elements of the sets, and a change of the list of rules replaces the table, each in one transaction. It needsnftand a kernel filtering what an interface sends to a guest, Linux 5.16 or later: the guest refuses to start where one is missing, and so does a guest with rules and nonetwork, whose interfaces libvirt makes, as the ones ofbridgeor of avirtinstcommand. With rules, a guest exchanges arp, ipv4 and ipv6 frames only. What an interface needs to hold its address passes whatever the rules: arp, the ipv6 neighbour discovery, the dhcp exchange of the guest, and the icmp errors sent to it.
What is not:
- A command run by
om <path> execor entering a container, which is the operator’s. - A published port of a docker container served by its userland proxy: the packets reach the container from the gateway of its bridge, not from the client, so the filter sees the gateway. Allowing the gateway allows every client of the port.
- A vbox container, whose traffic the cgroup of its processes does not
carry, and a kvm container with no
network. - What no socket of the processes filtered sends or receives. The filter of a cgroup judges the packets of the sockets of its processes, in whatever network namespace: what the kernel answers by itself in the network namespace of a container, as the reply to a ping, passes, and so does what that namespace forwards.
- A container whose root may configure its network. The filter keeps an
application to its peers: it is no confinement of the root of a lxc
container, or of a docker or podman container given
NET_ADMINor run privileged, who administers the network namespace the packets leave through, and is not to be relied on against it. A container to hold against its own root is run without that capability, in a user namespace, or as a kvm guest, whose filter is on the interfaces of the node.
Keyword netns
required: false
scopable: true
group: network
aliases: net
candidates: , none, host
references: container rid
rbac: A namespace other than none or a container#<n> of the object requires the root grant.
Example:
netns=container#0
Description:
-
empty or
noneThe container has a private netns other
container,ip.netnsorip.cniresources can share. -
<rid>The id of the resource that has the network namespace this container joins.
For example, a container with
netns=container#0will share thecontainer#0netns. -
hostShare the host network namespace.
Keyword on
required: false
scopable: true
group: scheduling
convert: list
Example:
on=NetworkPeersUpdated,name=backend1
Description:
The events of the node running the task, each one an event kind and the values
of the fields of the event it requires, as in om node events --filter:
NetworkPeersUpdated runs it when the peers of any network of the node
changed, NetworkPeersUpdated,name=backend1 when the ones of backend1 did.
The kinds are:
-
FileInstalled: an install of a resource of the object wrote files, or removed the files of keys gone, by a start, a provision, a task or a change of a key. It is not published for an install finding its files up to date. Its fields arenode,pathandrid, the resource, and the events of the other objects are not the task’s. -
NetworkPeersUpdated: a node joined or left a network, the address of a node changed, or the tunnel to it. Its fields arenodeandname, the network.
The runs are paced by pace, and require what the scheduled runs
require: the instance provisioned, and run_requires. They run whether the
instance is frozen or not, as the scheduled runs do.
A task installing again the files rendered from the networks with
install has them follow the networks:
[task#refresh]
type = host
install = fs#1
on = NetworkPeersUpdated
Keyword on_error
required: false
scopable: true
group: run
Example:
on_error=/srv/{name}/data/scripts/task_on_error.sh
Description:
A command to execute on run action if command returned an error.
Keyword optional
required: false
scopable: true
group: availability
convert: bool
Description:
Action errors on optional resources are logged but do not interrupt the action sequence.
The status of optional resources is not included in the instance availability status but is considered in the overall status.
The status of task and sync resources is always included in the overall status, regardless of whether they are marked as optional.
Resources tagged as noaction are considered optional by default.
Dump filesystems are a typical use case for optional=true.
Keyword osvc_root_path
required: false
scopable: true
group: guest
Example:
osvc_root_path=/opt/opensvc
Description:
If the OpenSVC agent is installed via package in the container, this keyword must not be set.
Else the value can be set to the fullpath hosting the agent installed from sources.
Keyword pace
required: false
scopable: true
group: scheduling
default: @10s
Example:
pace=@30s backoff @1m
Description:
The pace of the runs the on events ask for, @<interval>[ backoff @<max>],
written as the interval of a schedule.
The task runs at the first event, then once at most each interval: the events coming during an interval run it once at its end.
With backoff, each interval ending with such a run doubles the next one, up
to <max>, and each interval passing without an event halves it back, down to
<interval>: @30s backoff @1m runs at most each 30s, and at most each minute
while the events keep coming faster.
Keyword pg_blkio_weight
required: false
scopable: true
group: pg
Example:
pg_blkio_weight=50
Description:
Block IO relative weight. Value: between 10 and 1000.
The kernel default is 100.
Setting this keyword to default puts the capping back where a node that
never capped anything leaves it. Removing the keyword does not: what was
written stays written, whether om wrote it or something else did.
Keyword pg_cpu_burst
required: false
scopable: true
group: pg
Example:
pg_cpu_burst=20%
Description:
The cpu time the group banks under its quota, and spends above it.
It is the time the processes of the group may bank while under their
pg_cpu_quota, and spend above it in a short spike, in the notation of
pg_cpu_quota: 20% lets the group run a fifth of a cpu above its quota
during a period, out of what it left unused before.
It serves a latency-sensitive service capped tightly: a request arriving after an idle spell is served at the speed of the burst, rather than throttled for the rest of the period. Over a longer time the group still uses no more than its quota.
It needs pg_cpu_quota, and cannot exceed it: the kernel refuses a burst
larger than the quota. Only the unified cgroup hierarchy has it.
Setting this keyword to default puts the capping back where a node that
never capped anything leaves it. Removing the keyword does not: what was
written stays written, whether om wrote it or something else did.
Keyword pg_cpu_quota
required: false
scopable: true
group: pg
Example:
pg_cpu_quota=50%@all
Description:
The percentage of cpu time the processes of the group may use.
Accepted expressions:
-
50%Half of one cpu. -
50%@allHalf of every cpu the node has. -
10%@2A tenth of two cpus.
Unlike pg_cpu_shares, which only arbitrates when the node is cpu-bound, a
quota caps the group whether or not the node is busy.
Setting this keyword to default puts the capping back where a node that
never capped anything leaves it. Removing the keyword does not: what was
written stays written, whether om wrote it or something else did.
Keyword pg_cpu_shares
required: false
scopable: true
group: pg
convert: size
Example:
pg_cpu_shares=512
Description:
The share of cpu the group gets when the node is cpu-bound.
The share is relative to the other groups.
The actual percentile depends on the shares allowed to the other services. Unset, the kernel default is used, which usually is 1024 shares.
Setting this keyword to default puts the capping back where a node that
never capped anything leaves it. Removing the keyword does not: what was
written stays written, whether om wrote it or something else did.
Keyword pg_cpus
required: false
scopable: true
group: pg
depends: create_pg=true
Example:
pg_cpus=0-2
Description:
The cpus the processes of the group may run on.
Cpus are specified as list or range : 0,1,2 or 0-2.
Setting this keyword to default puts the capping back where a node that
never capped anything leaves it. Removing the keyword does not: what was
written stays written, whether om wrote it or something else did.
Keyword pg_mem_high
required: false
scopable: true
group: pg
convert: size
Example:
pg_mem_high=384m
Description:
The memory past which the kernel throttles the group, in bytes.
Past it, the kernel slows the processes of the group down, reclaiming their memory and throttling their allocations.
Unlike pg_mem_limit, reaching it does not wake the Out-Of-Memory killer: a
group above it keeps running, slower, while the kernel reclaims. Set below
pg_mem_limit, it gives a process growing too much the time to be noticed,
or to shrink, before it is killed.
It is a soft limit, so it is not what a memory claim counts: the claim counts
pg_mem_limit. Only the unified cgroup hierarchy has it.
Setting this keyword to default puts the capping back where a node that
never capped anything leaves it. Removing the keyword does not: what was
written stays written, whether om wrote it or something else did.
Keyword pg_mem_limit
required: false
scopable: true
group: pg
convert: size
Example:
pg_mem_limit=512m
Description:
The memory the processes of the group may use, in bytes.
The Out-Of-Memory killer is triggered in case of tresspassing.
Setting this keyword to default puts the capping back where a node that
never capped anything leaves it. Removing the keyword does not: what was
written stays written, whether om wrote it or something else did.
On a node holding the v1 cgroup hierarchy, default lifts the memory+swap
limit too: a group with no memory limit cannot keep one below it.
Keyword pg_mem_oom_control
required: false
scopable: true
group: pg
Example:
pg_mem_oom_control=1
Description:
Whether the Out of Memory killer runs for the group: 0 enables it.
It is a flag (0 or 1) enabling or disabling the Out of Memory killer for the processes of the group.
- If enabled (0), tasks that attempt to consume more memory than they are allowed are immediately killed by the OOM killer.
- If disabled (1), tasks are allowed to continue to try allocating memory, stressing the system.
The OOM killer is enabled by default in every cgroup using the memory controller.
This keyword caps nothing on a node holding the unified cgroup hierarchy,
which has no memory.oom_control: that file is of the v1 hierarchy. Setting
it there is warned about, and ignored.
Keyword pg_mem_swappiness
required: false
scopable: true
group: pg
Example:
pg_mem_swappiness=40
Description:
Set a swappiness percentile value for the process group.
This keyword caps nothing on a node holding the unified cgroup hierarchy,
which has no memory.swappiness: that file is of the v1 hierarchy. Setting
it there is warned about, and ignored.
Keyword pg_mems
required: false
scopable: true
group: pg
Example:
pg_mems=0-2
Description:
The memory nodes the processes of the group may allocate from.
Memory nodes are specified as list or range : 0,1,2 or 0-2.
Setting this keyword to default puts the capping back where a node that
never capped anything leaves it. Removing the keyword does not: what was
written stays written, whether om wrote it or something else did.
Keyword pg_pids_max
required: false
scopable: true
group: pg
Example:
pg_pids_max=512
Description:
The most processes and threads the group may run at once.
A fork beyond it fails in the process that asked for it, and nothing else of the node is touched: it is what keeps a runaway fork loop from exhausting the process table of the node.
Setting this keyword to default puts the capping back where a node that
never capped anything leaves it. Removing the keyword does not: what was
written stays written, whether om wrote it or something else did.
Keyword pg_vmem_limit
required: false
scopable: true
group: pg
convert: size
Example:
pg_vmem_limit=1g
Description:
The memory plus swap the processes of the group may use, in bytes.
The Out-Of-Memory killer is triggered in case of tresspassing.
The specified value must be greater than pg_mem_limit.
Setting this keyword to default puts the capping back where a node that
never capped anything leaves it. Removing the keyword does not: what was
written stays written, whether om wrote it or something else did.
Keyword pidns
required: false
scopable: true
group: isolation
candidates: , host
references: container rid
rbac: A namespace other than none or a container#<n> of the object requires the root grant.
Example:
pidns=container#0
Description:
-
empty
The container has a private pidns other containers can share. Usually a pidns sharer will run a
pauseimage to reap zombies. -
container#<i>Share
container#<i>pidns. -
hostShare the host’s pidns.
Keyword post_provision
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute after the resource provision action.
Errors do not interrupt the action.
This trigger is only executed on leaders.
Keyword post_run
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute after the resource run action.
Errors do not interrupt the action.
Keyword post_stop
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute after the resource stop action.
Errors do not interrupt the action.
Keyword post_unprovision
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute after the resource unprovision action.
Errors do not interrupt the action.
This trigger is only executed on leaders.
Keyword pre_provision
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute before the resource provision action.
Errors do not interrupt the action.
Keyword pre_run
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute before the resource run action.
Errors do not interrupt the action.
Keyword pre_stop
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute before the resource stop action.
Errors do not interrupt the action.
Keyword pre_unprovision
required: false
scopable: true
group: triggers
rbac: Triggers require the root grant.
Description:
A command or script to execute before the resource unprovision action.
Errors do not interrupt the action.
Keyword privileged
required: false
scopable: true
group: isolation
convert: bool
rbac: A privileged container requires the root grant.
Description:
Give extended privileges to the container.
Keyword provision
required: false
scopable: false
group: provisioning
default: true
convert: bool
Description:
Set to false to ignore the provision and unprovision actions on the
resource.
Warning:
provisionandunprovisionuse data-destructive operations like formatting.
It is recommended to set provision=false on long-lived critical objects,
to force administrators to remove this setting when they really want to
destroy data.
Keyword provision_requires
required: false
scopable: false
group: requirements
references: requires
Example:
provision_requires=ip#0 fs#0(down,stdby down)
Description:
A whitespace-separated list of conditions to meet to accept a ‘provision’ action.
A condition is expressed as <rid>(<state>,...).
If states are omitted, up,stdby up is used as the default expected states.
Keyword pull_timeout
required: false
scopable: true
group: image
default: 2m
convert: duration
Example:
pull_timeout=2m
Description:
Wait for <duration> before declaring the container action a failure.
Keyword read_only
required: false
scopable: true
group: storage
convert: tristate
Description:
Mount the root filesystem of the task container as read only.
The task writes only in its volume mounts and its tmpfs, as a container declaring the same keyword does.
Keyword registry_creds
required: false
scopable: true
group: image
Example:
registry_creds=creds-registry-opensvc-com
Description:
The name of a secret in the same namespace having a config.json key which
value is used to login to the container image registry.
If not specified, the node-level registry credential store is used.
Keyword retcodes
required: false
scopable: true
group: status
default: 0:up 1:down
Example:
retcodes=0:up 1:down 3:warn 4: n/a 5:undef
Description:
The whitespace-separated list of <retcode>:<status name>.
All undefined retcodes are mapped to the warn status.
Valid <status names> are:
updownwarnn/aundef
Keyword rm
required: false
scopable: true
group: process
convert: bool
Example:
rm=false
Description:
If rm=true, the container task instance is removed after successfully run.
The anonymous volumes of the container, those the engine creates for a
VOLUME of the image no volume_mounts entry covers, are removed with it.
The named volumes and the bind mounts are kept.
Keyword run_args
required: false
scopable: true
group: process
convert: shlex
rbac: Requires the root grant.
Example:
run_args=-v /opt/docker.opensvc.com/vol1:/vol1:rw -p 37.59.71.25:8080:8080
Description:
Extra arguments to pass to the docker run command, like volume and port mappings.
A --restart option is refused with net_rules: the engine
would restart the container by itself, with no network filter. om passes no
restart policy, and restarts the containers.
A --cgroup-parent or a --cgroups option is refused with it too: the
engine would place the container out of the slice om sets the network filter
on. om places the container in the slice of its process group.
Keyword run_requires
required: false
scopable: false
group: requirements
references: requires
Example:
run_requires=ip#0 fs#0(down,stdby down)
Description:
A whitespace-separated list of conditions to meet to accept a ‘run’ action.
A condition is expressed as <rid>(<state>,...).
If states are omitted, up,stdby up is used as the default expected states.
Keyword run_timeout
required: false
scopable: true
group: timeouts
convert: duration
Example:
run_timeout=1m30s
Description:
Wait for <duration> before declaring the action a failure.
Takes precedence over timeout.
Keyword schedule
required: false
scopable: true
group: scheduling
Example:
schedule=00:00-01:00 mon
Description:
Set the task run schedule.
See usr/share/doc/opensvc/schedule for the schedule syntax reference.
Keyword secrets_environment
required: false
scopable: true
group: environment
deprecated: since v3.0.0-rc57, replaced by environment
convert: shlex
Example:
secrets_environment=CRT=cert1/server.pem sec1/*
Description:
A whitespace-separated list of <var>=<sec name>/<key path> or
<sec name>/<key matcher>.
If the sec or secret key doesn’t exist then start and stop actions on
the resource will fail with a non 0 exit code.
A shell expression splitter is applied, so double quotes can be around
<sec name>/<key path> only or whole <var>=<sec name>/<key path>.
Example with,
-
<ns>/sec/cert1a secret having aserver.pemkey with valuemycrt. -
<ns>/sec/sec1a secret having akey1key with valueval1.
secrets_environment = CRT=cert1/server.pem sec1/* creates the following
variables in the container command execution environment:
CRT=mycrt
key1=val1
Keyword shared
required: false
scopable: true
group: provisioning
convert: bool
Description:
If true, the resource will be considered shared during provision and
unprovision actions.
A shared resource driver can implement a different behaviour depending on weither it is run from the leader instance, or not:
-
When
--leaderis set, the driver creates and configures the system objects. For example the disk.disk driver allocates a SAN disk and discover its block devices. -
When
--leaderis not set, the driver does not redo the actions already done by the leader, but may do some. For example, the disk.disk driver skips the SAN disk allocation, but discovers the block devices.
The daemon takes care of setting the --leader flags on the commands
it submits during deploy, purge, provision and unprovision
orchestrations.
Warning: If admins want to submit
--localprovision or unprovision commands themselves, they have to set the--leaderflag correctly.
Flex objects usually don’t use shared resources. But if they do, only
the flex primary gets --leader commands.
Warning: All resources depending on a shared resource must also be flagged as shared.
Keyword snooze
required: false
scopable: true
group: run
convert: duration
Example:
snooze=10m
Description:
Snooze the service before running the task, so if the command is cause a status degradation the user can decide to snooze alarms for the duration set as value.
Keyword standby
required: false
scopable: true
group: availability
convert: bool
Description:
If true, always start the resource, even on non-started instances.
The daemon is responsible for starting standby resources.
A resource can be set standby on a subset of nodes using keyword scoping.
A typical use-case is a synchronized filesystem on non-shared disks. The remote filesystem must be mounted to not overflow the underlying filesystem.
Warning: In most situation, don’t set shared resources standby, a non-clustered fs on shared disks for example.
Keyword stat_timeout
required: false
scopable: true
group: timeouts
convert: duration
Description:
The fs resources status evaluation includes a stat syscall test. This keyword defines the maximum wait time for those stat calls to respond.
When expired, the resource status is degraded is to warn, which can trigger a monitor action (reboot or crash the node) if the resource is monitored.
Keyword stop_requires
required: false
scopable: false
group: requirements
references: requires
Example:
stop_requires=ip#0 fs#0(down,stdby down)
Description:
A whitespace-separated list of conditions to meet to accept a ‘stop’ action.
A condition is expressed as <rid>(<state>,...).
If states are omitted, up,stdby up is used as the default expected states.
Keyword stop_timeout
required: false
scopable: true
group: timeouts
convert: duration
Example:
stop_timeout=2m
Description:
Wait for <duration> for the task container to exit on a stop before
killing it.
Unset, the container engine default applies.
Keyword subset
required: false
scopable: true
group: selection
Description:
The name of the subset this resource is assigned to.
Resources of a same driver group and a same subset are ordered and acted upon
together, and are configured as a whole in a [subset#<group>:<name>] section,
or in a less precise [subset#<name>] one.
That section accepts parallel, to act on the members concurrently rather than
one after the other, and the pg_* keywords, to place the members in their own
process group.
Keyword sysctl
required: false
scopable: true
group: isolation
convert: shlex
Example:
sysctl=kernel.shm_rmid_forced=1 net.ipv4.tcp_syncookies=1
Description:
Set namespaced kernel tunables exposed via sysctl in the task container.
Keyword tags
required: false
scopable: true
group: selection
convert: set
Description:
A whitespace-separated list of tags.
Tags can be used for resource selection by tag.
Some tags can influence the driver behaviour:
-
noactionSkip any state changing action on the resource and imply
optional=true. -
nostatusForce the status
n/a.
Keyword timeout
required: false
scopable: true
group: timeouts
convert: duration
Example:
timeout=5m
Description:
Wait for <duration> before declaring the task run action a failure.
If no timeout is set, the agent waits indefinitely for the task command to exit.
Keyword tty
required: false
scopable: true
group: process
convert: bool
Description:
Allocate a pseudo-tty.
Keyword type
required: false
scopable: false
group: identity
rbac: Requires the root grant, except for the values oci, docker, podman, acme.
Description:
The resource driver name.
Keyword unprovision
required: false
scopable: false
group: provisioning
default: true
convert: bool
Description:
Set to false to ignore the unprovision action on the resource.
Warning:
unprovisionuse data-destructive operations like formatting.
It is recommended to set provision=false on long-lived critical objects,
to force administrators to remove this setting when they really want to
destroy data.
Keyword unprovision_requires
required: false
scopable: false
group: requirements
references: requires
Example:
unprovision_requires=ip#0 fs#0(down,stdby down)
Description:
A whitespace-separated list of conditions to meet to accept a ‘unprovision’ action.
A condition is expressed as <rid>(<state>,...).
If states are omitted, up,stdby up is used as the default expected states.
Keyword user
required: false
scopable: true
group: process
Example:
user=guest
Description:
The user that will run the command inside the container.
Also support the <user>:<group> syntax.
Keyword userns
required: false
scopable: true
group: isolation
rbac: A namespace other than none or a container#<n> of the object requires the root grant.
Example:
userns=container#0
Description:
If not set, the container will have a private userns other containers can share.
A container with userns=host will share the host’s userns.
Keyword utsns
required: false
scopable: true
group: isolation
candidates: , host
rbac: A namespace other than none or a container#<n> of the object requires the root grant.
Example:
utsns=host
Description:
-
empty
The container has a private utsns.
-
hostThe container shares the host’s hostname.
Keyword volume_mounts
required: false
scopable: true
group: storage
convert: shlex
rbac: Host path mounts in container require the root grant.
Example:
volume_mounts=myvol1:/vol1 myvol2:/vol2:rw /localdir:/data:ro
Description:
The whitespace-separated list of <source>:<containerized mount path>:<mount options>.
The source is one of:
/srv/data, a directory of the node.volume#1:/etc/nginx, a directory or a file in the resourcevolume#1of the service, a volume or a filesystem, under its mount point.web-cfg/etc/nginx, a directory or a file in the volweb-cfgof the namespace, under its mount point.tmpfs, a memory filesystem of the container’s own, which the engine mounts at the start and discards at the stop:tmpfs:/var/lib/apportmpfs:/var/lib/app:size=16m,mode=0750. The<mount options>are the ones of a tmpfs. The memory it holds counts in the one of the container, which its memory limit bounds.
When the source is a directory of the node, the default <mount option> is rw.
When the source is in a volume, the default <mount option> is taken from the
volume access.