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

kubernetes: add max_parallel_image_pulls and serialize_image_pulls #59

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ settings-extension-dns = { path = "./bottlerocket-settings-models/settings-exten
settings-extension-ecs = { path = "./bottlerocket-settings-models/settings-extensions/ecs", version = "0.1" }
settings-extension-host-containers = { path = "./bottlerocket-settings-models/settings-extensions/host-containers", version = "0.1" }
settings-extension-kernel = { path = "./bottlerocket-settings-models/settings-extensions/kernel", version = "0.1" }
settings-extension-kubernetes = { path = "./bottlerocket-settings-models/settings-extensions/kubernetes", version = "0.1" }
settings-extension-kubernetes = { path = "./bottlerocket-settings-models/settings-extensions/kubernetes", version = "0.2" }
settings-extension-metrics = { path = "./bottlerocket-settings-models/settings-extensions/metrics", version = "0.1" }
settings-extension-motd = { path = "./bottlerocket-settings-models/settings-extensions/motd", version = "0.1" }
settings-extension-network = { path = "./bottlerocket-settings-models/settings-extensions/network", version = "0.1" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "settings-extension-kubernetes"
version = "0.1.0"
version = "0.2.0"
authors = ["Sean P. Kelly <[email protected]>"]
license = "Apache-2.0 OR MIT"
edition = "2021"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ pub struct KubernetesSettingsV1 {
seccomp_default: bool,
#[cfg(feature = "nvidia-device-plugin")]
device_plugins: K8sDevicePluginsSettings,
// Generated in `k8s-1.27+` variants only
serialize_image_pulls: bool,
max_parallel_image_pulls: i32,
Comment on lines +101 to +103
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these values not supported on older versions of kubelet?

If we add them like this, they'll still be in the settings API for older *-k8s-* builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, this feature landed in k8s-1.27: https://kubernetes.io/docs/concepts/containers/images/#maximum-parallel-image-pulls.

If we add them like this, they'll still be in the settings API for older -k8s- builds.

Also correct - my thought was that these settings would be ignored/unused in k8s < 1.27, and only included in a kubelet-config in kubernetes-1.27+ packages. We'd call out this distinction on the bottlerocket.dev Settings Index

Open to suggestions on a better approach here, though

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it makes sense to include the settings and document that they are ignored in older versions. Adding settings gated by a feature flag caused a few issues when we did it for nvidia-device-plugin settings, and in this case I don't think it makes sense to add a kubernetes-1.27+ top-level setting.

}

type Result<T> = std::result::Result<T, Infallible>;
Expand Down Expand Up @@ -197,6 +200,8 @@ mod test {
seccomp_default: None,
#[cfg(feature = "nvidia-device-plugin")]
device_plugins: None,
serialize_image_pulls: None,
max_parallel_image_pulls: None,
})
);
}
Expand Down