-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Pass TOML configuration options for runtimes CRI is not aware of #7764
Conversation
/test pull-containerd-sandboxed-node-e2e |
/test pull-containerd-sandboxed-node-e2e |
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM nice improvement
In containerd#7764 it was made so that generic runtime options in the containerd toml config file would get passed to shims regardless of if containerd knew of the type beforehand and could supply the struct. However, this was only added for the sandbox server fork here and not the regular ol' CRI server. This change just mirrors the parts that need to be plopped in pkg/cri/server Signed-off-by: Danny Canter <danny@dcantah.dev>
@@ -11,4 +11,7 @@ message Options { | |||
// ConfigPath specifies the filesystem location of the config file | |||
// used by the runtime. | |||
string config_path = 2; | |||
// Blob specifies an in-memory TOML blob passed from containerd's configuration section |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just seeing this change.
I'm wondering why this would be TOML?
This struct already has a type url supplied, why wouldn't the body be the marshaled raw data?
This seems extremely CRI specific.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean by raw data?
We configure runtimes in containerd in TOML format in the first place.
This change is the way to passthru a piece of that "runtime" section directly to the runtime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean the marshaled version, such as proto or json.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so per discussion..need an issue to align the type_url to logic specifying that said type defines the bytes in config_body if present...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #8246
In containerd#7764 it was made so that generic runtime options in the containerd toml config file would get passed to shims regardless of if containerd knew of the type beforehand and could supply the struct. However, this was only added for the sandbox server fork here and not the regular ol' CRI server. This change just mirrors the parts that need to be plopped in pkg/cri/server Signed-off-by: Danny Canter <danny@dcantah.dev>
In current implementation CRI offers
options
field in containerd's configuration file to configure runtimes. It's quite nice as it allows to have one configuration file for both containerd and the underlying runtimes. However this only works for options CRI is aware of.For all other runtime implementations there is no way to pass configuration (except to specify a config path, which runtime will use to read config file from disk).
This PR adds another option. It extends generic runtime options and adds a bytes blob.
containerd
can now pass entire TOML section specified for a runtime in that blob, so runtime implementations can unmarshal its configuration directly from that blob instead.