Skip to content

Commit

Permalink
podvm: re-arrange service order for sealed secrets
Browse files Browse the repository at this point in the history
For sealed secrets to work kata-agent needs to connect to CDH, since it
will repace env-variables in the container procoss with an unsealed
confidential secret. A systemd path monitor watches for the CDH socket
to appear to launch kata-agent.

Also, kata is writing the ocicrypt_config to /run in the agent process
so we should not have bundle another in the podvm disk.

Signed-off-by: Magnus Kulke <[email protected]>
  • Loading branch information
mkulke committed Nov 6, 2024
1 parent 489c96e commit 53187cd
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ enable attestation-protocol-forwarder.service
enable attestation-agent.service
enable api-server-rest.path
enable confidential-data-hub.path
enable kata-agent.service
enable kata-agent.path
enable [email protected]
enable process-user-data.service
enable setup-nat-for-imds.service
Expand Down
7 changes: 0 additions & 7 deletions src/cloud-api-adaptor/podvm/files/etc/ocicrypt_config.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[Unit]
Description=Agent Protocol Forwarder
After=kata-agent.service
Wants=kata-agent.service
DefaultDependencies=no


[Service]
Type=notify
EnvironmentFile=-/etc/default/agent-protocol-forwarder
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Unit]
Description=Monitor for the Confidential Data Hub socket

[Path]
PathExists=/run/confidential-containers/cdh.sock
Unit=kata-agent.service

[Install]
WantedBy=multi-user.target
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[Unit]
Description=Kata Agent
BindsTo[email protected]
Wants=process-user-data.service attestation-agent.service
After[email protected] process-user-data.service attestation-agent.service
After[email protected] process-user-data.service

[Service]
Environment=OCICRYPT_KEYPROVIDER_CONFIG=/etc/ocicrypt_config.json
ExecStartPre=mkdir -p /run/kata-containers
ExecStart=/usr/local/bin/kata-agent --config /run/peerpod/agent-config.toml
ExecStartPre=-umount /sys/fs/cgroup/misc
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion src/cloud-api-adaptor/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ oci:
tag: 3.9
kata-containers:
registry: ghcr.io/kata-containers/cached-artefacts
reference: 9a33a3413b222868232402a7412562f4f6fb5736
reference: a2b9527be36ce5adb76491a27c7e02780feade6b
guest-components:
registry: ghcr.io/confidential-containers/guest-components
reference: d8da69072424e496486dfb5421a26f16ff2a7abf

0 comments on commit 53187cd

Please sign in to comment.