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

fix: yurtadm support enable kubelet service #1523

Merged

Conversation

YTGhost
Copy link
Member

@YTGhost YTGhost commented Jun 6, 2023

What type of PR is this?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1520

Special notes for your reviewer:

@rambohe-ch

Does this PR introduce a user-facing change?


other Note

@openyurt-bot
Copy link
Collaborator

@YTGhost: 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?

/kind bug

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #1520

Special notes for your reviewer:

@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 Jun 6, 2023
@openyurt-bot openyurt-bot added the size/L size/L: 100-499 label Jun 6, 2023
@codecov
Copy link

codecov bot commented Jun 6, 2023

Codecov Report

Merging #1523 (f2f2971) into master (68893e4) will increase coverage by 0.02%.
The diff coverage is n/a.

❗ Current head f2f2971 differs from pull request most recent head d0d1a31. Consider uploading reports for the commit d0d1a31 to get more accurate results

@@            Coverage Diff             @@
##           master    #1523      +/-   ##
==========================================
+ Coverage   50.39%   50.42%   +0.02%     
==========================================
  Files         132      132              
  Lines       15707    15783      +76     
==========================================
+ Hits         7916     7958      +42     
- Misses       7069     7094      +25     
- Partials      722      731       +9     
Flag Coverage Δ
unittests 50.42% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 4 files with indirect coverage changes

@rambohe-ch
Copy link
Member

@huiwq1990 PTAL

@YTGhost YTGhost force-pushed the yurtadm-join-enable-kubelet branch from 8abaff5 to f2f2971 Compare June 7, 2023 01:38
@huiwq1990
Copy link
Member

@YTGhost
It should call enable kubelet after yurtadmutil.SetKubeletService().

func RunPrepare(data joindata.YurtJoinData) error {
	// cleanup at first
	staticPodsPath := filepath.Join(constants.KubeletConfigureDir, constants.ManifestsSubDirName)
	if err := os.RemoveAll(staticPodsPath); err != nil {
		klog.Warningf("remove %s: %v", staticPodsPath, err)
	}

	if err := system.SetIpv4Forward(); err != nil {
		return err
	}
	if err := system.SetBridgeSetting(); err != nil {
		return err
	}
	if err := system.SetSELinux(); err != nil {
		return err
	}
	if err := yurtadmutil.CheckAndInstallKubelet(data.KubernetesResourceServer(), data.KubernetesVersion()); err != nil {
		return err
	}
	if err := yurtadmutil.CheckAndInstallKubeadm(data.KubernetesResourceServer(), data.KubernetesVersion()); err != nil {
		return err
	}
	if err := yurtadmutil.CheckAndInstallKubernetesCni(data.ReuseCNIBin()); err != nil {
		return err
	}
	if err := yurtadmutil.SetKubeletService(); err != nil {
		return err
	}

Signed-off-by: Liang Deng <283304489@qq.com>
@YTGhost YTGhost force-pushed the yurtadm-join-enable-kubelet branch from f2f2971 to d0d1a31 Compare June 7, 2023 01:55
@sonarcloud
Copy link

sonarcloud bot commented Jun 7, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@YTGhost
Copy link
Member Author

YTGhost commented Jun 7, 2023

@YTGhost It should call enable kubelet after yurtadmutil.SetKubeletService().

func RunPrepare(data joindata.YurtJoinData) error {
	// cleanup at first
	staticPodsPath := filepath.Join(constants.KubeletConfigureDir, constants.ManifestsSubDirName)
	if err := os.RemoveAll(staticPodsPath); err != nil {
		klog.Warningf("remove %s: %v", staticPodsPath, err)
	}

	if err := system.SetIpv4Forward(); err != nil {
		return err
	}
	if err := system.SetBridgeSetting(); err != nil {
		return err
	}
	if err := system.SetSELinux(); err != nil {
		return err
	}
	if err := yurtadmutil.CheckAndInstallKubelet(data.KubernetesResourceServer(), data.KubernetesVersion()); err != nil {
		return err
	}
	if err := yurtadmutil.CheckAndInstallKubeadm(data.KubernetesResourceServer(), data.KubernetesVersion()); err != nil {
		return err
	}
	if err := yurtadmutil.CheckAndInstallKubernetesCni(data.ReuseCNIBin()); err != nil {
		return err
	}
	if err := yurtadmutil.SetKubeletService(); err != nil {
		return err
	}

@huiwq1990 Yes, I made a mistake, and now it has been revised

@huiwq1990
Copy link
Member

/lgtm

@openyurt-bot
Copy link
Collaborator

@huiwq1990: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Jun 7, 2023
@rambohe-ch
Copy link
Member

/lgtm

@openyurt-bot openyurt-bot added the lgtm lgtm label Jun 7, 2023
@openyurt-bot openyurt-bot merged commit 2c6dd31 into openyurtio:master Jun 7, 2023
11 of 12 checks passed
JameKeal pushed a commit to JameKeal/openyurt that referenced this pull request Jun 9, 2023
Signed-off-by: Liang Deng <283304489@qq.com>
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] yurtadm node join not auto enable kubelet
4 participants