-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Set containerd config on nodeup.Config instead of clusterspec #11750
Conversation
679574e
to
3bf70c8
Compare
3bf70c8
to
4094695
Compare
Are these so big they can't fit in userdata? I'm trying to keep non-empty AuxConfig to the uncommon case if possible. |
It's a good question. toml format is quite verbose. The default config is 500bytes, with GPU config is twice as big. Then people can add x number of registry mirror configurations, that is around 300 bytes each. Since it to some extent can be arbitrary bytes long, I thought it was a good candidate. |
We still have compression of user data. Maybe wait a little more with this? |
If we believe the config to be small enough, changing to nodeup.Config (which the former version of this PR used) is trivial. I am happy with either. |
Let's go with nodeup.Config for now. I'd like to keep as few things in AuxConfig as possible as a likely future refactor would merge AuxConfig into Config and spill Config to VFS when it gets too big. |
FYI, I'd like to move the docker config into nodeup.Config as well. Doesn't have to be this PR. |
eda157f
to
1eafd8b
Compare
1eafd8b
to
01087cc
Compare
pkg/apis/nodeup/config.go
Outdated
@@ -73,6 +73,9 @@ type Config struct { | |||
ConfigServer *ConfigServerOptions `json:"configServer,omitempty"` | |||
// AuxConfigHash holds a secure hash of the nodeup.AuxConfig. | |||
AuxConfigHash string | |||
|
|||
// Containerd config holds the configuration for containerd | |||
Containerd *ContainerdConfig `json:"containerd,omitempty"` |
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.
Can be extended later if there's any need for it.
Containerd *ContainerdConfig `json:"containerd,omitempty"` | |
ContainerdConfig string `json:",omitempty"` |
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.
This config is unversioned. I don't think we can extend it in the future as that would break nodeup/cloudup marshaling.
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.
But it's just part of the launch template, which is updated together with new version of nodeup?
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.
If I understand @johngmyers correctly, there is an idea about writing this to VFS at some point.
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.
That is an alternative for large user data cases, if I understand correctly.
For containerd there are no flags to control various aspects, everything can be done through the config file, which will be generated in cloudup. So, I don't see any need for extending this short term.
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.
The fact that it's unversioned isn't a problem because the reader (nodeup) always matches the version of the writer (kops). So we can make incompatible changes with impunity.
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 was thinking you'd run into the autoscaling edge case, but you are right. This doesn't apply here.
I'll amend then.
f724687
to
3f8020a
Compare
65820fb
to
23ba363
Compare
This allows us to set a default containerd config per IG (e.g add a different config for GPU IGs) Can also be considered a cleanup as we no longer use containerd.overrideConfig as a mechanism for bringing the default containerd config from cloudup to nodeup.
23ba363
to
e7fa3fa
Compare
if cluster.Spec.Containerd == nil { | ||
cluster.Spec.Containerd = &kops.ContainerdConfig{} | ||
} | ||
config.ContainerdConfig = buildContainerdConfig(cluster) |
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.
One last suggestion. This only makes sense to be done if container runtime is containerd.
/lgtm
if cluster.Spec.Containerd == nil { | |
cluster.Spec.Containerd = &kops.ContainerdConfig{} | |
} | |
config.ContainerdConfig = buildContainerdConfig(cluster) | |
if cluster.ContainerRuntime == "containerd" { | |
if cluster.Spec.Containerd == nil { | |
cluster.Spec.Containerd = &kops.ContainerdConfig{} | |
} | |
config.ContainerdConfig = buildContainerdConfig(cluster) | |
} |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: johngmyers The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This allows us to set a default containerd config per IG (e.g add a different config for GPU IGs)
Can also be considered a cleanup as we no longer use containerd.overrideConfig as a mechanism for bringing the default containerd config from cloudup to nodeup.