Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

process-user-data: process cloud-config yamls #1644

Merged

Conversation

mkulke
Copy link
Contributor

@mkulke mkulke commented Dec 28, 2023

fixes #1639

The process-user-data tool is processing cloud-config data now instead of a raw daemon config json file. The latter required setting a parameter on the DaemonSet configuration, depending on whether a PodVM image has been built w/ cloud-config disabled or not.

The support is limited to the write_files directive and a subset of properties, specifically path and content, as those are set by the cloud provider code. Parsing will fail if additional properties are encountered.

In theory provider code can set additional properties, but atm we don't. (we might consider removing the unused props in the cloudconfig code, to avoid confusion)

All write_files entries but the one with path: $daemonConfigPath will be ignored.

In the CAA code the DISABLE_CLOUD_CONFIG flag has been removed and providers will always set cloud-config files as user-data. For packer based builds, the DISABLE_CLOUD_CONFIG env is still used to pick process-user-data instead of the system's cloud-init service.

Testing done

Tested peerpod deployment successfully on Azure with an mkosi-based image (uses process-user-data exclusively) and a CAA daemonset with the -disable-cloud-config flag removed.

@mkulke mkulke force-pushed the mkulke/parse-cloud-config branch 6 times, most recently from fc7b8ca to b069d28 Compare December 29, 2023 16:18
@mkulke mkulke marked this pull request as ready for review December 29, 2023 16:26
@mkulke mkulke added enhancement New feature or request podvm Related to podvm images labels Dec 29, 2023
Copy link
Member

@bpradipt bpradipt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
Tested it successfully on AWS

cmd/process-user-data/main_test.go Outdated Show resolved Hide resolved
cmd/process-user-data/provision.go Show resolved Hide resolved
The process-user-data tool is processing cloud-config data now instead
of a raw daemon config json file. The latter required setting a
parameter on the DaemonSet configuration, depending on whether a PodVM
image has been built w/ cloud-config disabled or not.

The support is limited to the `write_files` directive and a subset of
properties, specifically `path` and `content`, as those are set by the
cloud provider code. Parsing will fail if additional properties are
encountered.

In theory provider code can set additional properties, but atm we don't.
(we might consider removing the unused props in the cloudconfig code, to
avoid confusion)

All `write_files` entries but the one with `path: $daemonConfigPath`
will be ignored.

In the CAA code the `DISABLE_CLOUD_CONFIG` flag has been removed and
providers will always set cloud-config files as user-data. For packer
based builds, the `DISABLE_CLOUD_CONFIG` env is still used to pick
process-user-data instead of the system's cloud-init service.

Signed-off-by: Magnus Kulke <magnuskulke@microsoft.com>
@mkulke mkulke merged commit bc47b70 into confidential-containers:main Jan 12, 2024
16 checks passed
@mkulke mkulke deleted the mkulke/parse-cloud-config branch January 12, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request podvm Related to podvm images
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podvm: make process-user-data support cloud-config yaml
3 participants