| Field | Type | Description | Value(s) |
|---|---|---|---|
name | string | Name of the container. Must be between 1 and 63 characters long, and can only contain lowercase ASCII letters, digits and hyphens. It is used as the containerd container ID and as the container’s log identifier, so it may not collide with a Talos service name. | |
image | string | OCI image reference supplying the container’s root filesystem. A digest-pinned reference ( repo@sha256:...) is recommended: it is the only formthat guarantees the same bytes on every pull. Short references are accepted and normalized, so nginx becomes index.docker.io/library/nginx:latest. | |
entrypoint | []string | Overrides the image’s ENTRYPOINT. Unset means the image’s own entrypoint is used. | |
args | []string | Overrides the image’s CMD. | |
workingDir | string | Overrides the image’s WORKDIR. | |
runAs | ContainerRunAs | Overrides the image’s USER uid and/or gid. There are no user namespaces, so a container running as uid 0 is root on the host. | |
environment | []string | Environment variables, in KEY=value form, merged over the image’s own ENV.Values are stored in the machine configuration verbatim, so treat anything put here as being as sensitive as the machine configuration itself. | |
mounts | ContainerMount | Filesystems to mount into the container. | |
devices | ContainerDevice | Devices to hand to the container. | |
security | ContainerSecurity | Security settings for the container. | |
network | ContainerNetwork | Network settings for the container. | |
resources | ContainerResources | Resource limits, applied as cgroup v2 settings. | |
lifecycle | ContainerLifecycle | Lifecycle settings for the container. |
runAs
ContainerRunAs overrides the image’s user and group.| Field | Type | Description | Value(s) |
|---|---|---|---|
uid | int32 | UID to run the container’s entrypoint as. Unset means use the image’s own USER. There are no user namespaces, so uid 0 is host root. Required when the image’s USER names its user rather than giving a numeric uid (e.g. app or app:app): Talos does not read the image’s /etc/passwd, and rejectssuch a container instead of running it as root. | |
gid | int32 | GID to run the container’s entrypoint as. Unset means use the image’s own USER. Required when the image’s USER names its group (e.g. app:app), or names only a user(e.g. app), whose primary group would come from the image’s /etc/passwd: Talos doesnot read it, and rejects such a container instead of running it as root. |
mounts[]
ContainerMount describes a single filesystem to mount into the container. Exactly one source must be set. Raw OCI mounts are deliberately not exposed; every source is typed so that Talos can reason about what a container is allowed to reach.| Field | Type | Description | Value(s) |
|---|---|---|---|
volume | VolumeMount | Mount a user, existing or external volume by name. The name is that of a UserVolumeConfig, ExistingVolumeConfig orExternalVolumeConfig document. Volume names are unique across those kinds, so thename resolves to one volume. The volume must be declared in the same configuration. The volume is mounted from /var/mnt/<name> on the host. Declaring this mount alsomakes the container wait for the volume to be mounted before it starts. | |
tmpfs | TmpfsMount | Mount a tmpfs for scratch space. | |
hostPath | HostPathMount | Bind-mount a path from the host. The source must already exist; Talos will not create it. This is the widest of the three sources and the only one that can reach arbitrary host state. |
volume
VolumeMount mounts a volume by name.| Field | Type | Description | Value(s) |
|---|---|---|---|
name | string | Name of the volume to mount. The name of a UserVolumeConfig, ExistingVolumeConfig or ExternalVolumeConfig document. | |
destination | string | Absolute path inside the container’s mount namespace. | |
options | []string | Mount options. Volume mounts are writable by default (rw).A volume whose ExistingVolumeConfig or ExternalVolumeConfig declares itread-only must be mounted with ro. | rorwnoexecnosuidnodevnoatimerbindrshared |
tmpfs
TmpfsMount mounts a tmpfs.| Field | Type | Description | Value(s) |
|---|---|---|---|
destination | string | Absolute path inside the container’s mount namespace. | |
size | string | Size of the tmpfs, e.g. 64MiB. Empty means the kernel default. | |
options | []string | Mount options. Tmpfs mounts are writable by default (rw). |
hostPath
HostPathMount bind-mounts a host path.| Field | Type | Description | Value(s) |
|---|---|---|---|
source | string | Absolute path on the host. Must already exist. | |
destination | string | Absolute path inside the container’s mount namespace. | |
options | []string | Mount options. Host path mounts are writable by default (rw). |
devices[]
ContainerDevice describes a single device to hand to the container. Exactly one source must be set.| Field | Type | Description | Value(s) |
|---|---|---|---|
rawVolume | RawVolumeDevice | Hand a raw volume to the container as a block device. The raw volume is referenced by the name of its RawVolumeConfig document.The container gets a device node at the destination and is allowed to read and write that device, and no other block device. This works with the restricted profile,no capabilities are added. For an encrypted raw volume the node is the unlocked device. Declaring this device makes the container wait for the raw volume to be ready, and the raw volume is not closed while the container is running. A raw volume can be handed to a single container only. |
rawVolume
RawVolumeDevice hands a raw volume to the container by name.| Field | Type | Description | Value(s) |
|---|---|---|---|
name | string | Name of the RawVolumeConfig document. | |
destination | string | Path of the device node inside the container. Must be under /dev/, and not one of the entries the container runtime creates thereitself (e.g. /dev/null, /dev/pts). The node keeps the owner and mode of the deviceon the host. |
security
ContainerSecurity configures the container’s security posture.| Field | Type | Description | Value(s) |
|---|---|---|---|
profile | ContainerSecurityProfile | Security profile.restricted drops all capabilities, allows no device access, and mounts the rootfsand sysfs read-only. privileged grants all grantable capabilities and all devices,and mounts sysfs read-write. | restrictedprivileged |
capabilities | ContainerCapabilities | Linux capabilities to add or drop on top of the profile. When the container runs as a non-root user (through runAs or the image’s USER), theresulting capabilities (the profile’s, minus drop, plus add) are also raised into theambient set, so that they remain effective after the entrypoint is executed. Ambient capabilities are inherited by every program the container runs, not only its entrypoint, so grant only what the workload needs. | |
machinedAccess | bool | Publishes the container’s PID so machined’s API can recognize it, and bind-mounts the machined API socket into the container. This alone does not grant DAC access to the socket, which is owned by the apid user:reaching it in practice still requires profile: privileged or an equivalent capability/runAs grant. Once connected, the container may request any role, same as extensionservices; the RPC’s own role requirements are what actually gate access. | |
seccompProfile | ContainerSeccomp | Seccomp profile applied to the container. Unset means the containerd default seccomp profile, independently of the security profile: even a privileged container is filtered by it. |
capabilities
ContainerCapabilities adjusts the container’s Linux capabilities.| Field | Type | Description | Value(s) |
|---|---|---|---|
add | []string | Capabilities to grant, without the CAP_ prefix. | |
drop | []string | Capabilities to remove, without the CAP_ prefix. ALL removes every capability. |
seccompProfile
ContainerSeccomp selects the seccomp filter applied to the container. For compatibility, a bare profile type (e.g.seccompProfile: unconfined) is accepted as a
shorthand for seccompProfile: {type: unconfined}.
| Field | Type | Description | Value(s) |
|---|---|---|---|
type | ContainerSeccompProfile | Seccomp profile type.default applies the containerd default seccomp profile. unconfined applies noseccomp filter at all, which some workloads need, e.g. a nested container runtime creating session keyrings. localhost applies the profile named by localhostProfile. | defaultunconfinedlocalhost |
localhostProfile | string | Name of the seccomp profile to apply, declared by a SeccompProfileConfig document(or the deprecated .machine.seccompProfiles field).Required with, and only allowed with, type: localhost. Updating the referencedprofile restarts the container with the new profile. |
network
ContainerNetwork configures the container’s network namespace.| Field | Type | Description | Value(s) |
|---|---|---|---|
mode | ContainerNetworkMode | Network mode.none gives the container its own empty network namespace with no host access.host shares the host network namespace, so the container sees every interface andcan bind any port. | nonehost |
resources
ContainerResources configures cgroup v2 resource limits.| Field | Type | Description | Value(s) |
|---|---|---|---|
limits | ContainerResourceLimits | Hard ceilings the container cannot exceed. |
limits
ContainerResourceLimits are hard ceilings.| Field | Type | Description | Value(s) |
|---|---|---|---|
cpu | string | CPU ceiling in millicores, mapped onto cgroup v2 cpu.max.1000m is one core. | |
memory | string | Memory ceiling, mapped onto cgroup v2 memory.max.Exceeding it OOM-kills the container. | |
swap | string | Swap ceiling, mapped onto cgroup v2 memory.swap.max.0 keeps the container’s memory out of swap entirely, so its memory ceiling is enforcedby the OOM killer rather than by swapping. Unset leaves the container free to use the node’s swap. |
lifecycle
ContainerLifecycle configures how Talos starts, runs and stops the container.| Field | Type | Description | Value(s) |
|---|---|---|---|
dependsOn | ContainerDependsOn | Conditions which must be satisfied before the container is started. | |
healthCheck | ContainerHealthCheck | Probe deciding whether the running container is healthy. Without a health check, a running container is healthy. With one, it is reported as pending until the first check passes, and as degraded once failureThreshold consecutivechecks fail. A failing check never restarts the container. Health gates other containers which list this one in lifecycle.dependsOn.containers.The probe connects to 127.0.0.1 inside the container’s network namespace. | |
stopTimeout | Duration | Time the container gets to exit after SIGTERM before it is killed with SIGKILL. It applies whenever Talos stops the container: on shutdown, reboot and upgrade, when it is replaced after a change or restarted with talosctl restart, and when it is removed.Defaults to 10s. Must be greater than 0 and at most 4m. Changing it replaces the running container, which is still stopped with its previous timeout. | |
restart | ContainerRestart | How the container is restarted after it exits. |
dependsOn
ContainerDependsOn gates container startup on external conditions.| Field | Type | Description | Value(s) |
|---|---|---|---|
paths | []string | Host paths which must exist before the container starts. Polled, so a path that never appears leaves the container waiting indefinitely. | |
network | []string | Network readiness conditions which must be satisfied. | addressesconnectivityhostnameetcfiles |
time | bool | Whether the clock must be synchronized before the container starts. | |
containers | ContainerDependency | Other containers, by document name, which must be running first, or have succeeded. An entry is either the name of a container which must be running and healthy, or a name with a condition. On shutdown, reboot and upgrade, the container is stopped before them, as long as that fits into the time the shutdown gives the containers. The order applies to the containers on the same node only. Cycles are rejected when the machine configuration is applied. |
containers[]
ContainerDependency is a container which must be running, or have succeeded, first.| Field | Type | Description | Value(s) |
|---|---|---|---|
name | string | Name of the ContainerConfig document. | |
condition | ContainerDependencyCondition | running (the default) waits for the container to be running and healthy, succeeded forit to have exited with code 0 and not to be restarted, e.g. a container preparing what this one needs. It is checked again on every boot, as the containers run again. | runningsucceeded |
healthCheck
ContainerHealthCheck configures a probe which decides whether a running container is healthy. Exactly one of tcp, http or grpc must be set.| Field | Type | Description | Value(s) |
|---|---|---|---|
tcp | ContainerTCPHealthCheck | Probe by opening a TCP connection to the port. The check passes if the connection is established. | |
http | ContainerHTTPHealthCheck | Probe by sending an HTTP GET request to the port. The check passes if the response status is in the 200-399 range. | |
grpc | ContainerGRPCHealthCheck | Probe by calling the gRPC health checking protocol (grpc.health.v1.Health/Check) on the port.The check passes if the reported status is SERVING. | |
initialDelay | Duration | Delay after the container starts before the first check runs. Defaults to 0s. | |
interval | Duration | Interval between checks. Defaults to 10s. | |
timeout | Duration | Time after which a single check is considered failed. Defaults to 1s, and may not exceed the interval. | |
failureThreshold | uint32 | Number of consecutive failed checks after which the container is reported degraded. Defaults to 3. |
tcp
ContainerTCPHealthCheck probes a TCP port.| Field | Type | Description | Value(s) |
|---|---|---|---|
port | uint16 | Port to connect to on the container’s loopback address. |
http
ContainerHTTPHealthCheck probes an HTTP endpoint.| Field | Type | Description | Value(s) |
|---|---|---|---|
port | uint16 | Port to connect to on the container’s loopback address. | |
path | string | Request path. Defaults to /. |
grpc
ContainerGRPCHealthCheck probes a gRPC health service.| Field | Type | Description | Value(s) |
|---|---|---|---|
port | uint16 | Port to connect to on the container’s loopback address. | |
service | string | Service name to pass in the health check request. Empty asks for the overall health of the server. |
restart
ContainerRestart configures how the container is restarted after it exits.| Field | Type | Description | Value(s) |
|---|---|---|---|
policy | ContainerRestartPolicy | When the container is restarted after it exits.always restarts it after every exit, on-failure after it failed (a non-zero exit codeor a failure to start), and never runs it once.A container which is not restarted keeps its outcome until its configuration changes or it is removed, and runs again after a reboot or a restart of machined. talosctl restart only signals the container, so it doesn’t run such a container again. | alwayson-failurenever |
maxRetries | int | How many times a failed container is restarted at most, with the on-failure policy.Unset restarts it until it succeeds. | |
delay | Duration | Time to wait after the container exited before it is restarted. Defaults to 5s. | |
maxDelay | Duration | Longest time to wait before a restart. The delay doubles with each restart of a container which ran for a shorter time than this, up to this. Defaults to the delay, so the delay doesn’t grow. |