vm-manager runs where the KVM devices are: as a pod of a KVM node on the Agent Platform
(On Kubernetes below), or directly on a host — a laptop, a
bare-metal node, a GitHub Actions runner. The host part of this guide installs it as a system service with
deploy/systemd/vm-manager.service. The daemon
needs no root: everything it does (QEMU, swtpm, the userspace network, the IMDS) runs
as an unprivileged user with access to three device nodes. What the service is and how
it works is in the README; local development loops are in
development.md.
| Need | Arch Linux | Notes |
|---|---|---|
| KVM | kernel module kvm_intel / kvm_amd, /dev/kvm |
get_host reports /dev/kvm under missing when it is not accessible |
| vsock | module vhost_vsock, /dev/vhost-vsock |
carries READY=1 from the guests and exec_vm's ssh to them; see the udev rule below |
| QEMU | qemu-system-x86 (or qemu-full) |
qemu-system-x86_64 on $PATH |
| swtpm | swtpm |
one vTPM process per VM |
| OVMF | vm-manager's own build (firmware/README.md), no distribution package |
make firmware fetches it into firmware/build; install OVMF_CODE.fd, OVMF_VARS.fd and firmware.json to /usr/share/vm-manager/firmware/, the default, or pass --ovmf-code / --ovmf-vars. VMs boot it with SMM and Secure Boot |
| systemd (optional) | systemd (any recent version) |
transient units the VMs survive restarts in (--launcher systemd); without it VMs are child processes of serve |
| storage provider (optional) | systemd 261 with io.systemd.StorageProvider |
when the fs provider's socket answers under /run/systemd/io.systemd.StorageProvider/, VM disks are provider volumes; otherwise plain files below <state-dir>/volumes/ |
| ssh client (optional) | openssh |
only for a person's own session with a guest, ssh -i <state-dir>/vms/<id>/ssh_key root@vsock/<cid> (systemd's ssh_config.d/20-systemd-ssh-proxy.conf resolves vsock/<cid>); exec_vm and the e2e tests speak ssh themselves |
| image build (optional) | mkosi >= 27, erofs-utils, python-pefile, gnupg, go 1.26+, sfdisk (util-linux), crane (the CNI sysext's plugins) |
only on the machine that builds images, see below |
Any distribution with these packages works; the paths in the table are what the code
probes. vm-manager serve starts on a host that lacks some of them and reports the gaps
through GET /api/v1/host (ready: false, missing: [...] — the two devices, the two
binaries and the firmware; systemd and the storage provider are reported as found or not
but never required) so an operator or an agent can see what to install; create_vm fails
until ready is true.
Device access. /dev/kvm is root:kvm 0660 on every mainstream distribution.
/dev/vhost-vsock is often root:root 0600; give it to the same group:
cat >| /etc/udev/rules.d/60-vhost-vsock.rules <<'EOF'
KERNEL=="vhost-vsock", GROUP="kvm", MODE="0660"
EOF
udevadm control --reload && udevadm trigger --name-match=vhost-vsock
echo vhost_vsock >| /etc/modules-load.d/vhost-vsock.conf && modprobe vhost_vsockThe service unit adds the vm-manager user to kvm with SupplementaryGroups= and
whitelists exactly /dev/kvm, /dev/vhost-vsock and /dev/net/tun with DeviceAllow=.
Nothing else on the host is touched: the virtual networks are userspace
(gvisor-tap-vsock), so no bridges, tap devices, iptables rules or CAP_NET_ADMIN.
vm-manager boots the image built in images/: the
giantswarm-vm-base disk image plus UKI, and the Kubernetes sysext. On a machine with
mkosi:
git clone https://github.com/giantswarm/vm-manager && cd vm-manager
make -C images # keys, base image, kubernetes sysext, verifyThat leaves in images/build/:
giantswarm-vm-base_<v>.efi UKI (installer boot and the kernel of every boot)
giantswarm-vm-base_<v>.raw disk image, attached read-only to the installer boot
policy.json expected PCR 11 per phase, PCR 13 per Kubernetes version
sysupdate/base/ A/B OS update artifacts + SHA256SUMS(.gpg)
sysupdate/kubernetes/ kubernetes_<kv>.raw + SHA256SUMS(.gpg)
Copy these five entries into the image directory of the host (the default is
<state-dir>/images, /var/lib/vm-manager/images with the unit below). The catalog
scans for <id>_<version>.efi + .raw pairs, takes policy.json for the image it
names, and serves sysupdate/ to the guests over the IMDS. A production host gets the
artifacts from wherever your release pipeline publishes them; the directory contract is
the same.
Keys. make -C images keys generates development keys into the git-ignored
images/keys/ (verity certificate, PCR signing key, PGP key for SHA256SUMS). They are
baked into the image (/usr/lib/verity.d/, /etc/systemd/import-pubring.pgp), so the
sysext and the update artifacts of one build only verify against the base image of the
same key set. For production, build with keys from your CA and keep images/keys/ out
of the host: vm-manager only serves signed artifacts and never holds a private key.
Golden PCR values. A freshly built policy.json has PCR 11 and PCR 13 but no golden
values for the firmware PCRs (0, 2-4, 6, 7), and the server rejects every quote until they
exist: nothing turns attestation off. They are recorded once per image and host firmware
with vm-manager image golden, as the release pipeline records them, see
First VM. Copy the resulting policy.json alongside the image to every host
with the same OVMF build, or repeat the step per host.
make build # ./vm-manager, static
install -Dm0755 vm-manager /usr/local/bin/vm-manager
install -Dm0644 deploy/systemd/sysusers.d/vm-manager.conf /usr/lib/sysusers.d/vm-manager.conf
install -Dm0644 deploy/systemd/vm-manager.service /etc/systemd/system/vm-manager.service
systemd-sysusers # creates the vm-manager user (in group kvm)
loginctl enable-linger vm-manager # its own service manager runs the VMs, see below
install -d -o vm-manager -g vm-manager -m 0750 /var/lib/vm-manager /var/lib/vm-manager/images
cp -r images/build/giantswarm-vm-base_* images/build/policy.json images/build/sysupdate /var/lib/vm-manager/images/
chown -R vm-manager:vm-manager /var/lib/vm-manager/images
systemctl daemon-reload
systemctl enable --now vm-managerThe unit runs vm-manager serve --state-dir=/var/lib/vm-manager --image-dir=/var/lib/vm-manager/images --listen=127.0.0.1:8080. Everything else comes
from /etc/vm-manager/env (EnvironmentFile=-, optional): every flag of serve has
the environment variable named in vm-manager serve --help, for example
# /etc/vm-manager/env
VM_MANAGER_NETWORK_SUBNET=192.168.127.0/24
VM_MANAGER_BOOT_TIMEOUT=6m
# Required: the identity provider, see README "Identity". serve does not start without it.
VM_MANAGER_OAUTH_BASE_URL=http://127.0.0.1:8080
DEX_ISSUER_URL=https://dex.example.com
DEX_CLIENT_ID=agent-platform
DEX_CLIENT_SECRET=...
OAUTH_TRUSTED_AUDIENCES=agent-platformFlags on the command line win over the environment, so --listen, --state-dir and
--image-dir are fixed by the unit; use a drop-in (systemctl edit vm-manager) to change
them. Every request but /healthz and /readyz needs a bearer token, an id_token of
that provider for a trusted audience: the examples below send it as $T
(T="Authorization: Bearer <id_token>"). There is no anonymous mode, on loopback
neither.
QEMU and swtpm do not run inside vm-manager.service. vm-manager starts them as transient
systemd units (vm-manager-<id>-qemu.service, vm-manager-<id>-swtpm.service, grouped in
vm-manager.slice) of the vm-manager user's own service manager, user@<uid>.service.
Stopping or restarting vm-manager.service leaves them running (--detach-vms-on-exit,
default on); the next start reattaches through vms/<id>/vm.json in the state dir, exit
status included, and the VMs stay ready. Package upgrades therefore need no maintenance
window. The exception is the upgrade to per-VM network ports: a VM started before it
reconnects to its network's former shared socket, networks/<name>/qemu.sock, which no
longer exists, and has no network until reboot_vm (or stop_vm and start_vm) starts its
QEMU on its own port.
That user manager exists only while the user has a session or lingering is enabled, hence
the loginctl enable-linger vm-manager above (it survives reboots; loginctl show-user vm-manager -p Linger says yes). vm-manager finds the manager at /run/user/<uid>
by itself: Environment=XDG_RUNTIME_DIR= in the unit is not needed and %U would not
help, since in a system unit %U is the UID of the service manager, 0, not of User=
(man systemd.unit, "Specifiers"). The kvm group membership from sysusers.d matters here
too: the VMs run outside the unit's SupplementaryGroups= and DeviceAllow=, so they open
/dev/kvm and /dev/vhost-vsock with the user's own groups.
Without lingering (or with --launcher process) vm-manager falls back to plain child
processes and logs VMs run as child processes and end with vm-manager at startup; then
a stop or restart powers every VM down (ACPI, then SIGTERM and SIGKILL after
--stop-timeout, 30 s by default; the unit gives the shutdown 90 s) and the VMs come back
stopped with a note in lastError; start_vm boots them again. The startup log line
vm launcher selected launcher=systemd manager=user confirms the intended mode, and
systemd-cgls --user-unit vm-manager.slice (as the vm-manager user) or systemctl --machine vm-manager@ --user list-units 'vm-manager-*' lists the running VMs.
Two things in the state dir are part of this contract: notify-port, the vsock port the
guests report READY=1 to (fixed in each guest's credentials at boot, so every start
reuses it; a second vm-manager on the same state dir fails with "notify port in use"), and
lock, an flock(2) that makes a second vm-manager on the same state dir fail fast.
journalctl -u vm-manager -f # "vm-manager starting", storage provider, image catalog, default network
curl -s localhost:8080/healthz # ok, the only answer without a token
curl -s -H "$T" localhost:8080/api/v1/host | jq '{ready, missing, qemu, swtpm, ovmfCode, storageProviders}'
curl -s -H "$T" localhost:8080/api/v1/images | jq '.[] | {id, version, kubernetesVersions}'
curl -s -H "$T" localhost:8080/api/v1/networks | jq '.[] | {name, cidr: .spec.cidr, gateway}'The log names the storage provider it selected (systemd or file), the number of
images in the catalog (a warning when zero) and the default network: serve creates the
network named default from --network-subnet (192.168.127.0/24) when the state
directory does not hold one yet, and restores it with its leases afterwards. To change the
default subnet delete the network (DELETE /api/v1/networks/default, once no VM is
attached) and restart; a different subnet in the flag is only logged otherwise. Another
network is one call:
curl -s -H "$T" -X POST localhost:8080/api/v1/networks \
-d '{"name":"lab","cidr":"192.168.130.0/24","dns_search_domain":"lab.internal"}' | jq .gatewayEvery network has its own L2 segment, DHCP, DNS forwarder, NAT to whatever the host
reaches, and the IMDS at 169.254.169.254.
A new image or firmware gets its golden values recorded first, the way the release
pipeline records them: vm-manager image golden boots a reference VM of the image on the
host's firmware in its own process, writes the PCRs of its ready quote into the image's
policy.json and verifies a fresh VM against them. The server reads the policy at start:
sudo -u vm-manager vm-manager image golden giantswarm-vm-base --image-dir /var/lib/vm-manager/images
systemctl restart vm-manager
API=localhost:8080/api/v1
ID=$(curl -s -H "$T" -X POST $API/vms -d '{"name":"node-1","wait_for":"ready"}' | jq -r .id)
curl -s -H "$T" $API/vms/$ID | jq '{state, ip, attestation, lastError}'
curl -s -H "$T" $API/vms/$ID/attestation | jq . # initrd and ready quote, both verifiedcreate_vm with wait_for: ready blocks through the installer boot (installing, about
12 s), the installed boot (booting, attesting) and returns once the guest's service
manager sent READY=1 (11 to 15 s after the installed boot starts). From now on every
VM of that image attests against the recorded values: a boot on other firmware is
rejected with a golden mismatch on the PCRs that differ, killed, and never receives its
user-data. image golden writes golden.sha256 into the image's policy.json, so it
needs write access to the image directory (hence sudo -u vm-manager).
Work with the VM:
curl -s -H "$T" -X POST $API/vms/$ID/exec -d '{"command":["systemctl","is-system-running"]}' | jq .
curl -s -H "$T" -X POST $API/vms/$ID/forward -d '{"port":22}' | jq . # 127.0.0.1:<port> on the host
curl -s -H "$T" "$API/vms/$ID/console?lines=40" | jq -r .console
curl -s -H "$T" $API/vms/$ID/metrics | jq .host
curl -s -H "$T" -X DELETE $API/vms/$ID -o /dev/null -w '%{http_code}\n'A VM meant for a Kubernetes cluster gets kubernetes_version (the sysext version the
guest pulls at boot; default: the newest the image offers) and user_data, the CAPI
bootstrap Secret as Ignition JSON, released to the guest only after a verified initrd
quote. The README "VM lifecycle" and "Attestation" sections describe the
boot; e2e/kubernetes_cluster_test.go is a complete control plane plus worker through
the API.
The same operations as MCP tools: point an MCP client at http://127.0.0.1:8080/mcp
(streamable HTTP) with the token as its bearer; development.md shows the raw initialize / tools/call exchange
with curl.
| What | Where |
|---|---|
vm-manager log (slog text; debug logging is the -v flag, added through a drop-in on ExecStart=) |
journalctl -u vm-manager |
| serial console of a VM | GET /api/v1/vms/{id}/console?lines= (get_vm_console), the file /var/lib/vm-manager/vms/<id>/console.log |
| why a VM failed | lastError of get_vm (the console tail for installer failures), then the console |
| the guest journal | exec_vm with ["journalctl","-b","-u","vm-agent-attest.service"], ["journalctl","-b","-p","warning"], ["systemctl","--failed"] |
| attestation verdicts | GET /api/v1/vms/{id}/attestation (get_vm_attestation); rejected quotes are also on the guest console (vm-agent-attest.service) |
the guest's last systemd-report upload |
GET /api/v1/vms/{id}/report, summarized by get_vm_metrics, as series on /metrics |
| Prometheus | GET /metrics with a token or the scrape token of --metrics-token-file, never without (--metrics-enabled=false turns the exposition off) |
State directory layout, all below /var/lib/vm-manager:
networks.json network specs and leases
networks/<name>/<n>.sock a VM's port: the unix socket its QEMU attaches to, n the host number of its address
vms/<id>/vm.json the VM record
vms/<id>/console.log serial console
vms/<id>/user-data Ignition JSON served as /user-data, removed once the first boot consumed it
vms/<id>/ssh_key vm-manager's per-VM key for exec_vm, ssh_host_key the pinned guest key
vms/<id>/ovmf_vars.fd per-VM OVMF variable store
vms/<id>/tpm/ swtpm state (the vTPM's identity; delete_vm removes it)
vms/<id>/swtpm.log swtpm's own log, the previous run's in swtpm.prev.log
vms/<id>/run/qmp.sock QMP socket while QEMU runs
vms/<id>/report.json last guest report
volumes/ VM disks when no systemd storage provider is present
images/ the image directory of this guide
Keep the state directory path short: the unix socket paths below it are bounded by the kernel's 108-byte limit.
A new base image version is a new giantswarm-vm-base_<v>.efi + .raw pair next to the
old one; create_vm without an explicit image takes the newest version, an explicit
"image": "giantswarm-vm-base_<v>" pins one. The sysupdate/base/ directory is what the
guests' systemd-sysupdate (/usr/lib/sysupdate.d/*.transfer, A/B partitions) would
pull from http://169.254.169.254/giantswarm/v1/sysupdate/base/; the image ships the
transfers with systemd-sysupdate.timer disabled, so in-place OS updates are an explicit
systemd-sysupdate update inside the guest for now. Existing VMs keep the image they
installed; the intended upgrade path for cluster nodes is delete and recreate.
A new Kubernetes version is a new kubernetes_<kv>.raw in sysupdate/kubernetes/, listed
in its SHA256SUMS (signed as SHA256SUMS.gpg with the key the image trusts). The
directory is served unfiltered; each guest selects its version by reading
/kubernetes-version from the IMDS, so several versions can coexist and a VM pins its
own with kubernetes_version. list_images shows the versions the catalog found. Today's
images/scripts/publish-sysupdate writes a SHA256SUMS with only the version it just
built; a multi-version directory has to merge the manifests until
wave 4, row 21 lands.
policy.json is per image version: make -C images verify recomputes PCR 11 and 13 for
the new build and keeps the golden values of the same image version; a new version (or a
firmware update on the host) needs image golden again.
helm/vm-manager is vm-manager as a platform pod, the shape the
agent-platform meta chart installs as
components.vm-manager (off by default; a node with KVM is the prerequisite). Released by
the generated CircleCI pipeline on every release tag: the image
gsoci.azurecr.io/giantswarm/vm-manager:<version> (Ubuntu 26.04's QEMU, swtpm and OVMF next
to the binary, x86-64), the chart oci://gsoci.azurecr.io/charts/giantswarm/vm-manager:<version>
in the giantswarm catalog, and the guest image the pod boots as the OCI artifact
gsoci.azurecr.io/giantswarm/vm-manager-guest-image:<version>.
What the chart renders, and why:
- A Deployment (one replica,
Recreate) runningserve --launcher process --state-dir /var/lib/vm-manager --image-dir /var/lib/vm-manager/images, unprivileged: root with seven capabilities (CHOWN, DAC_OVERRIDE, FOWNER, KILL, SETUID, SETGID, SETPCAP: starting each VM's processes as their own user and handing them their files),allowPrivilegeEscalation: false, a read-only root, seccompUnconfinedwith vm-manager's own filter on itself and every process it starts — the container runtime's default set plusAF_VSOCK, which that set refuses and the guests' READY=1 and ssh need; vm-manager always installs it, with no way to turn it off, and refuses to start when it is not in force or a filter around it refuses vsock. The guest-image init container runs under the runtime's own profile (RuntimeDefault). The pod requests onegiantswarm.io/kvm. Nothing is mounted from the node (the networks are userspace: no bridges, no tap devices, noCAP_NET_ADMIN). - A DaemonSet
vm-manager device-pluginon the same nodes (nodeSelector,affinity,tolerations): a kubelet device plugin that advertisesgiantswarm.io/kvmwhile the node has/dev/kvmand/dev/vhost-vsock, and hands both to the pod that requests it, admitted by the device cgroup. The chart's only node paths: the kubelet's/var/lib/kubelet/device-plugins(the devices' health comes from/sys/class/misc, which every container sees), as root without any capability. It hands exactly those two devices, with no flag for others. It is not optional, and the Deployment always requests onegiantswarm.io/kvm. A rollout starts the new plugin before the old one stops (maxSurge: 1,maxUnavailable: 0), each on a socket named after its pod, so the kubelet moves the resource to the new registration and never rejects a vm-manager pod admitted meanwhile for unhealthy devices. A node restart is the kubelet's own case: it re-admits the pods it had before any plugin registers again, so the vm-manager pod that ran there endsFailed(UnexpectedAdmissionError) and its ReplicaSet starts a new one once the plugin is back, without intervention, as for every device plugin resource; theFailedpod object stays until it is deleted or the control plane's terminated-pod garbage collection removes it. - vm-manager runs as root in the pod, so QEMU and swtpm of each VM run as a user of
their own (
--vm-uid-base, default 0x70000000: one uid per VM, then one group per network), with no capability and QEMU under its-sandbox. A guest that takes over its QEMU reaches neither the node nor another VM's disk, vTPM state or files. Two vm-managers on one node need different bases. - No service manager in the pod, so QEMU and swtpm are children of the process and end
with it: a pod restart stops the VMs. Their records, disks (plain files, no storage
provider) and vTPM state survive on a claim (
persistence.existingClaim, orpersistence.create: true); without one the state is an emptyDir. - The guest image is a published artifact: an init container runs
vm-manager image pullbefore the server starts and fetchesguestImage.registry/repository:tag(the chart's appVersion by default, the digest its release signed when the chart carries one inguest-image.digest;guestImage.digestpins a manifest,guestImage.registryCAnames a ConfigMap with the CA of a registry under a private CA, a lab's or a mirror's (always HTTPS with the certificate verified; there is no plain HTTP),guestImage.pullSecretnames adockerconfigjsonSecret for a private mirror) into/var/lib/vm-manager/images— the image directory is part of the state volume. Before it writes anything the pull requires the release's signature on that digest: cosign keyless, a Fulcio certificate issued to the CircleCI project of giantswarm/vm-manager on av*tag (the tag it pulls, when it pulls by tag), logged in Sigstore's transparency log, the trust root fetched from Sigstore's TUF repository (tuf-repo-cdn.sigstore.dev, HTTPS, like the registry). An unsigned artifact, or one signed by anybody else or for another release, fails the init container with that reason: the artifact decides the UEFI db certificate, the IPE policy, the sysexts and the golden values attestation compares against. No value accepts an unsigned artifact. A released vm-manager trusts its release's signature alone; one built from source also trusts the build keys it was built with (vm-manager image trustlists them), which is how a lab boots its own builds, signed at push (vm-manager image push --sign-key). A released artifact'spolicy.jsoncarries the golden PCR values its release pipeline recorded for the same release's container image, so the pod verifies its VMs' attestation quotes from the first boot. A directory that already holds that digest (.guest-image.json) is left alone; another digest replaces the contents. A guest image from elsewhere carries the values recorded for the container image's firmware before its push (hack/guest-image-golden.sh), as a release's does.guestImage.enabled: falsefetches nothing (the chart's own install smoke). - OAuth, always, against the platform identity: the issuer, client, client secret and
CA fall back to
global.identity.*and the base URL toglobal.domain, the way model-manager's chart reads them; the chart does not render without them, and no value turns the guard off. A JWKS host other than the issuer's that resolves to a private address goes inoauth.sso.allowPrivateIPJWKSHosts. The Dex client reaches a private address and followsHTTP_PROXY,HTTPS_PROXYandNO_PROXYwithout a setting. The trusted audiences areoauth.trustedAudiences(default the platform client) plusmuster.mcpServer.auth.requiredAudiences. - The scrape token (
metrics): a random token the chart generates once into the Secret<fullname>-metrics(kept across upgrades;metrics.existingSecretnames one of your own, for a renderer without cluster access), mounted for--metrics-token-file.GET /metricsaccepts it besides the OAuth tokens and nothing else does. The ServiceMonitor (serviceMonitor.enabled) scrapes with it (authorizationfrom that Secret), so the Prometheus Operator, or Alloy, needs to read Secrets in the release namespace. - The muster
MCPServer(muster.mcpServer.enabled):streamable-httpto the Service,auth.type: oauthwithforwardToken: true, labelledagent-platform.giantswarm.io/tool-group: agent-platform— the platform's own management surface, next to agent-manager and model-manager — and annotatedui.giantswarm.io/display-name: VM Manager(muster.mcpServer.displayName), the name the Dev Portal shows. - The NetworkPolicy is always rendered, and it is the guests' policy too: their traffic
leaves through the pod's network (userspace NAT), so a VM reaches what the pod may reach.
- Ingress: the API port for the callers in
networkPolicy.ingressPods(pod label maps in the release namespace; default muster) andnetworkPolicy.ingressNamespaces, and while the ServiceMonitor is rendered its collectors inserviceMonitor.scrapers({namespace, matchLabels}; default the observability platform'salloy-metricsinkube-system). The kubelet's probes come from the node, which no policy blocks. - Egress: DNS in
kube-system, an in-cluster OTLP collector named byobservability.otel.endpoint, the in-cluster peers ofnetworkPolicy.egressPeers(an identity provider served from the cluster, as the agentlab's Dex is:{namespace, matchLabels, ports}), and for the guests every public address on every port:0.0.0.0/0except10.0.0.0/8,172.16.0.0/12,192.168.0.0/16and100.64.0.0/10(they hold the node, pod and Service CIDRs),169.254.0.0/16(cloud metadata services) and Azure's WireServer168.63.129.16/32, always.networkPolicy.excludedCIDRsadds a cluster network in public address space to those exceptions;networkPolicy.privateCIDRsadmits a named private destination outside the cluster (a VPC-peered registry), refusing link-local and WireServer. - No value turns the policy off or opens every destination. The peers of
egressPeersandprivateCIDRsare reachable for the guests as well.
- Ingress: the API port for the callers in
- Resources: a memory limit bounds the sum of the VMs' memory too (they are processes of this container); the chart sets requests only.
Pod restarts and the golden values: the chart's default guest image is the artifact of
its own release and brings values recorded for the container image's firmware. A guest
image from elsewhere (a local build pushed to a lab registry, guestImage.repository,
signed with a build key the pod's vm-manager, built from source, trusts) whose policy.json
was recorded against another firmware needs its values recorded for the container
image's firmware: hack/guest-image-golden.sh <vm-manager image> <image dir> on a KVM host
before the push, as the release pipeline does.
Against the Pod Security Standards (Kyverno's restrict-*, require-* and disallow-*
policies on Giant Swarm clusters, which enforce the restricted one) the chart's pods need
these exceptions, and nothing more; the chart ships none (on the Agent Platform the meta chart's connectivity chart
carries its components' exceptions):
| Workload | Rule (policy) | Why |
|---|---|---|
Deployment vm-manager |
run-as-non-root (require-run-as-nonroot), run-as-non-root-user (require-run-as-non-root-user) |
root, to start each VM's QEMU and swtpm as a user of their own |
Deployment vm-manager |
adding-capabilities-strict (disallow-capabilities-strict) |
the seven capabilities above, all within the baseline standard |
Deployment vm-manager |
check-seccomp (restrict-seccomp), check-seccomp-strict (restrict-seccomp-strict) |
Unconfined, which the baseline standard refuses too: vm-manager installs the default set plus AF_VSOCK itself |
DaemonSet vm-manager-device-plugin |
host-path (disallow-host-path), restricted-volumes (restrict-volume-types) |
the kubelet's device plugin directory, its one host path |
DaemonSet vm-manager-device-plugin |
run-as-non-root (require-run-as-nonroot), run-as-non-root-user (require-run-as-non-root-user) |
its socket in the kubelet's root-owned directory |
Match them by the pods' app.kubernetes.io/name (vm-manager,
vm-manager-device-plugin) and app.kubernetes.io/instance labels, with the autogen
copies for Deployments, DaemonSets and ReplicaSets. Neither pod is privileged, escalates
privileges or uses the host's namespaces: Kyverno's audit reports these rules and no
other Pod Security one for the two. Apart from the standards, Giant Swarm's
require-emptydir-requests-and-limits reports the Deployment's /tmp emptyDir, which has
no ephemeral-storage request or limit.
- Installed as above, vm-manager is unprivileged and QEMU and swtpm of every VM run as
the
vm-manageruser, under QEMU's-sandboxbut shared by all VMs; a user of their own per VM needs vm-manager to run as root, as the chart does. - VMs survive service restarts only with a service manager for the vm-manager user (lingering, see above); without one they are child processes and stop with the service. A swtpm whose unit cannot be queried at reattach is treated as gone and no longer managed, even if the process is alive.
- One host per vm-manager; nothing schedules across hosts. The virtual network is userspace: hundreds of Mbit/s, IPv4 only, no UDP or ICMP from the host into the network.
publish-sysupdatekeeps only the last published Kubernetes version inSHA256SUMS(above).- A Kubernetes version change applies on the next boot of a VM, never to a running node.
- The Prometheus endpoint is unauthenticated by design; firewall it or turn it off where that matters.