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

Add options to control images pulling of kubelet #11094

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tu1h
Copy link
Member

@tu1h tu1h commented Apr 17, 2024

What type of PR is this?
/kind feature

What this PR does / why we need it:
This PR provides two options to control the images pulling efficiency of kubelet.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`kubelet_serialize_image_pulls` controls if Kubelet pulls images one at a time, `kubelet_max_parallel_image_pulls` represents the maximum number of image pulls in parallel 

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 17, 2024
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 17, 2024
@tu1h tu1h force-pushed the kubelet_pull_image branch 3 times, most recently from 2f3ca71 to 150c92e Compare April 17, 2024 11:09
Copy link
Member

@MrFreezeex MrFreezeex left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution :D
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 17, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: MrFreezeex, tu1h
Once this PR has been reviewed and has the lgtm label, please assign cristicalin for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 19, 2024
@@ -174,4 +174,8 @@ topologyManagerScope: {{ kubelet_topology_manager_scope }}
tracing:
endpoint: {{ kubelet_tracing_endpoint }}
samplingRatePerMillion: {{ kubelet_tracing_sampling_rate_per_million }}
{% endif %}
serializeImagePulls: {{ kubelet_serialize_image_pulls | bool | lower }}
Copy link
Member

Choose a reason for hiding this comment

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

HI @tu1h

Is it OK change it like to:

{% if kubelet_serialize_image_pulls is defined %}
....
{% endif %}

like the other optional variable.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe, but @MrFreezeex suggested to avoid using is defined in Kubespray. :-)

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm perhaps we could be adding this line in the if in the line just below (and in that case it could be "hard coded" to false), there are a few other example that would be like that. It would prevent the usage of is defined and not add those line by default (if this was the concern?)

@MrFreezeex
Copy link
Member

(forgot to readd the lgtm label sorry)
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 10, 2024
# Whether pull images one at a time
kubelet_serialize_image_pulls: true
# The maximum number of image pulls in parallel. This option takes effect if kubelet_serialize_image_pulls is false
kubelet_max_parallel_image_pulls: 5
Copy link
Member

Choose a reason for hiding this comment

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

HI @tu1h

The maxParallelImagePulls default value is nil: https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration.

So we need to comment on it by default like:

# kubelet_max_parallel_image_pulls: 5

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated it, please check if it is applicable.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 14, 2024
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

Copy link
Contributor

@VannTen VannTen left a comment

Choose a reason for hiding this comment

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

See this : https://github.com/kubernetes/kubernetes/blob/68baa105f06c8a49eae242882ef531f7b5082fac/pkg/kubelet/apis/config/v1beta1/defaults.go#L209-L216

To me, this means we can simply get away with only 1 variable maxParrallelImagePulls, defaulting to 1 (that or nil has the exact same effect.
This would have the benefits of a simpler template (no need for is defined which is something I'm actively trying to get rid of 😆 )

@tu1h
Copy link
Member Author

tu1h commented May 15, 2024

See this : https://github.com/kubernetes/kubernetes/blob/68baa105f06c8a49eae242882ef531f7b5082fac/pkg/kubelet/apis/config/v1beta1/defaults.go#L209-L216

To me, this means we can simply get away with only 1 variable maxParrallelImagePulls, defaulting to 1 (that or nil has the exact same effect. This would have the benefits of a simpler template (no need for is defined which is something I'm actively trying to get rid of 😆 )

It's a nice solution for me. What do you think? @yankay @MrFreezeex

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants