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

move runonce from flag to config #89128

Merged

Conversation

vincent178
Copy link
Contributor

@vincent178 vincent178 commented Mar 14, 2020

What type of PR is this?
/kind api-change

What this PR does / why we need it:

part of Migrate Kubelet flags to config #86843

Ref #86843

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Yes. It exposes the RunOnce option in Kubelet's ComponentConfig API.

Kubelet's --runonce option is now also available in Kubelet's config file as `runOnce`.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [Usage]: https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Mar 14, 2020
@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Mar 14, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @vincent178!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 14, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @vincent178. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@vincent178 vincent178 changed the title move runonce from flag to config [WIP] move runonce from flag to config Mar 14, 2020
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. area/kubelet kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 14, 2020
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Mar 15, 2020
Copy link
Contributor

@mtaufen mtaufen left a comment

Choose a reason for hiding this comment

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

Thanks @vincent178! Left some comments.

// run those in addition to the pods specified by static pod files, and exit.
// Default: false
// +optional
RunOnce bool
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 the test you mentioned on Slack may be failing because this doesn't have the json:"runOnce,omitempty" tag.

// TODO(mtaufen): It is increasingly looking like nobody actually uses the
// Kubelet's runonce mode anymore, so it may be a candidate
// for deprecation and removal.
// If runOnce is true, the Kubelet will check the API server once for pods,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you format this comment like the others (start with the field name, as it would appear in JSON)?

// runOnce causes the Kubelet to check the API server once for pods,
// run those in addition to the pods specified by static pod files, and exit.
// Default: false
// +optional

@@ -490,6 +490,14 @@ type KubeletConfiguration struct {
// Default: "/etc/resolv.conf"
// +optional
ResolverConfig string `json:"resolvConf,omitempty"`
// TODO(mtaufen): It is increasingly looking like nobody actually uses the
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove this comment :). If we ever decide to remove it, it would best be done as a v2 API in the distant future.

@@ -238,6 +238,12 @@ type KubeletConfiguration struct {
// ResolverConfig is the resolver configuration file used as the basis
// for the container DNS resolution configuration.
ResolverConfig string
// TODO(mtaufen): It is increasingly looking like nobody actually uses the
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto for removing this TODO comment.

@vincent178 vincent178 requested a review from mtaufen March 19, 2020 22:38
Copy link
Contributor

@mtaufen mtaufen left a comment

Choose a reason for hiding this comment

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

Thanks, one additional comment.

Also, if you haven't seen it yet, there are some instructions here: https://docs.google.com/document/d/10Kz__miCWEOekC6WnsUdxYWSLrf-t1AkHHpZN57ei5c/edit#heading=h.mupqgfuyjwnm

@@ -238,6 +238,9 @@ type KubeletConfiguration struct {
// ResolverConfig is the resolver configuration file used as the basis
// for the container DNS resolution configuration.
ResolverConfig string
// If runOnce is true, the Kubelet will check the API server once for pods,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you update this comment to match the one on the public type (just the text part, not the default or optional)?

// RunOnce causes the Kubelet to check the API server once for pods,
// run those in addition to the pods specified by static pod files, and exit.

@mtaufen
Copy link
Contributor

mtaufen commented Mar 24, 2020

Do you also need to update k8s.io/kubernetes/pkg/kubelet/apis/config/helpers_test.go to include RunOnce in the list of kubeletConfigurationNonPathFieldPaths?

@vincent178 vincent178 force-pushed the move-runonce-kubeletconfiguration branch from 6ddec8b to 343fba6 Compare March 24, 2020 22:20
@mtaufen
Copy link
Contributor

mtaufen commented Apr 10, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Apr 10, 2020
@mtaufen mtaufen changed the title [WIP] move runonce from flag to config move runonce from flag to config Apr 10, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 10, 2020
@mtaufen
Copy link
Contributor

mtaufen commented Apr 10, 2020

Sorry for the delay @vincent178. I updated the PR description with some additional details and removed the [WIP] from the title, as this looks good.

/lgtm

@mtaufen
Copy link
Contributor

mtaufen commented Apr 10, 2020

/priority important-longterm

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. lgtm "Looks good to me", indicates that a PR is ready to be merged. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 10, 2020
@mtaufen
Copy link
Contributor

mtaufen commented Apr 10, 2020

/approve

@mtaufen
Copy link
Contributor

mtaufen commented Apr 10, 2020

/assign @liggitt
for overall approval

@fejta-bot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@vincent178
Copy link
Contributor Author

/assign @lavalamp

@liggitt
Copy link
Member

liggitt commented Apr 13, 2020

go ahead and squash this to a single commit, then lgtm

@vincent178 vincent178 force-pushed the move-runonce-kubeletconfiguration branch from 343fba6 to 745b742 Compare April 13, 2020 22:01
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 13, 2020
@vincent178
Copy link
Contributor Author

@liggitt @mtaufen squashed to single commit now, would you mind take another look? Thanks

@vincent178
Copy link
Contributor Author

/retest

@mtaufen
Copy link
Contributor

mtaufen commented Apr 16, 2020

/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 16, 2020
@liggitt
Copy link
Member

liggitt commented Apr 23, 2020

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, mtaufen, vincent178

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 23, 2020
@vincent178
Copy link
Contributor Author

/retest

1 similar comment
@vincent178
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit 30cefca into kubernetes:master Apr 24, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubelet cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. 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

6 participants