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

Yurtctl modify kube-controllersetting to close the nodelifecycle-controller #399

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

Peeknut
Copy link
Member

@Peeknut Peeknut commented Jul 29, 2021

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage
/sig storage

/kind bug

What this PR does / why we need it:

If kube-controlller-manager is deployed as a static pod, yurtctl convert turn off nodelifecycle controller by modifying kube-controller-manager.yaml instead of deleting clusterrolebinding system:controller:node-controller. So OpenYurt cluster created by yurtctl can run normally and support the high availability of kube-controller-manager.

Which issue(s) this PR fixes:

Fixes #391

Special notes for your reviewer:

/assign @rambohe-ch

Does this PR introduce a user-facing change?


other Note

@openyurt-bot
Copy link
Collaborator

@Peeknut: GitHub didn't allow me to assign the following users: your_reviewer.

Note that only openyurtio members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time.
For more information please see the contributor guide

In response to this:

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:
/kind bug
/kind documentation
/kind enhancement
/kind good-first-issue
/kind feature
/kind question
/kind design
/sig ai
/sig iot
/sig network
/sig storage
/sig storage
/kind bug

What this PR does / why we need it:

If kube-controlller-manager is deployed as a static pod, yurtctl convert turn off nodelifecycle controller by modifying kube-controller-manager.yaml instead of deleting clusterrolebinding system:controller:node-controller. So OpenYurt cluster created by yurtctl can run normally and support the high availability of kube-controller-manager.

Which issue(s) this PR fixes:

Fixes #391

Special notes for your reviewer:

/assign @rambohe-ch

Does this PR introduce a user-facing change?


other Note

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.

@openyurt-bot openyurt-bot added the kind/bug kind/bug label Jul 29, 2021
@openyurt-bot openyurt-bot requested review from Fei-Guo and kadisi July 29, 2021 07:56
@openyurt-bot openyurt-bot added the size/L size/L: 100-499 label Jul 29, 2021
- /bin/sh
- -c
args:
- "nsenter -t 1 -m -u -n -i -- sed -i 's/--controllers=-nodelifecycle,/--controllers=/g' {{.pod_manifest_path}}/kube-controller-manager.yaml"
Copy link
Member

Choose a reason for hiding this comment

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

if no --controllers parameter is set in kube-controller-manager.yaml, the above command can not disable nodelifecycle controller.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, yes. In the cluster installed by kubeadm, the static file of kube-controller-manager contains this parameter --controllers by default. In order to deal with other situations, the situation without this parameter should indeed be considered.
And the method of modifying files will be optimized in the future to make string matching more accurate instead of using sed.

if err = kubeutil.RunServantJobs(ro.clientSet,
map[string]string{
"action": "enable",
"yurtctl_servant_image": ro.YurtctlServantImage,
Copy link
Member

Choose a reason for hiding this comment

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

why use ro.YurtctlServantImage to enable or disable nodelifecycle controller?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because the system architecture may be amd64, arm64, arm, using a unified basic image may cause problems. So the parameter of yurtctl convert --yurtctl-servant-image is reused here.
The yurtctl-servant image may be separated from yurtctl in the future for more elegant use.

@rambohe-ch
Copy link
Member

/lgtm
/approve

@openyurt-bot openyurt-bot added the lgtm lgtm label Jul 30, 2021
@openyurt-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Peeknut, rambohe-ch

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

@openyurt-bot openyurt-bot added the approved approved label Jul 30, 2021
@openyurt-bot openyurt-bot merged commit 7438f76 into openyurtio:master Jul 30, 2021
MrGirl pushed a commit to MrGirl/openyurt that referenced this pull request Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved approved kind/bug kind/bug lgtm lgtm size/L size/L: 100-499
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]How yurtctl convert can better close the nodelifecycle controller (kube-controller-manager)?
3 participants