weaveworks / ignite

Ignite a Firecracker microVM
https://ignite.readthedocs.org
Apache License 2.0
3.49k stars 224 forks source link

Pass vm.Labels to runtime containers #852

Open networkop opened 3 years ago

networkop commented 3 years ago

Right now VM labels only exist on a VM itself. The only label that's propagated to the containers is ignite.name https://github.com/weaveworks/ignite/blob/main/pkg/operations/start.go#L77

It'd be nice to propagate the full set of labels to the underlying container as well. wdyt?

darkowlzz commented 3 years ago

Sounds good to me. We'll have to add some validation in the labels to prevent the user provided VM labels from overwriting the ignite set labels like ignite.name.

stealthybox commented 3 years ago

Notable that k8s api machinery dictates labels be dns-1123 subdomains. That means that labels should be small and in a fairly restricted schema that should be compatible with most or all container runtimes. (currently, docker and containerd are supported by ignite.)

Should be okay to just pass down all VM labels to container runtime, with the exception of ignite runtime necessities like ignite.name.

This lets ignite propagate user-created partitions in their VM workloads into the container runtime, which can make cleanup and debugging more comprehensible.