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

Support getting serviceCIDR from spec.Containers[0].Args of kube-controller-manager Pod #3243

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

ty-dc
Copy link
Collaborator

@ty-dc ty-dc commented Feb 26, 2024

Thanks for contributing!

What type of PR is this?

What this PR does / why we need it:

Which issue(s) this PR fixes:

In issue #3180, users encountered an issue where getting the serverCIDR failed in the rke2 cluster. The version they are using is v0.9.1, which has been fixed in PR #3211. But since new features are added to the main branch, the problem still needs to be fixed in main based on the new features.

The problem is as follows:

When kubeadm-config does not exist, get the podCIDR and serviceCIDR from the kube-controller-manager Pod. Due to different cluster deployment methods, there may be two types: Spec.Containers[0].Command and Spec.Containers[0].Args. For example, if the RKE2 cluster uses Spec.Containers[0].Args instead of Spec.Containers[0].Command, serviceCIDR will not be obtained, resulting in the inability to create Pods.

Fixes #3210

Copy link

codecov bot commented Feb 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.12%. Comparing base (d826534) to head (00f92bc).
Report is 6 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3243      +/-   ##
==========================================
- Coverage   81.85%   81.12%   -0.73%     
==========================================
  Files          50       50              
  Lines        5373     5373              
==========================================
- Hits         4398     4359      -39     
- Misses        813      856      +43     
+ Partials      162      158       -4     
Flag Coverage Δ
unittests 81.12% <ø> (-0.73%) ⬇️

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

see 1 file with indirect coverage changes

@ty-dc ty-dc changed the title Support getting serviceCIDR from Containers.Args Support getting serviceCIDR from spec.Containers[0].Args of kube-controller-manager Pod Feb 26, 2024
@@ -336,6 +336,9 @@ func (cc *CoordinatorController) syncHandler(ctx context.Context, coordinatorNam
return
}

// Spiderpool can automatically fetch ClusterCIDR.
Copy link
Collaborator

Choose a reason for hiding this comment

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

fetchPodAndServerCIDR:how about pod CIDR

Signed-off-by: ty-dc <tao.yang@daocloud.io>
@Icarus9913 Icarus9913 merged commit e483ecd into spidernet-io:main Feb 28, 2024
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sync to serviceCIDR failed and status was not set to not-ready
3 participants