-
Notifications
You must be signed in to change notification settings - Fork 362
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
Feature/support ipv6 dual #1537
Conversation
2. Support choose log color mode. 3. Support silence usage, because usage info is noisy in some cases; 4. Silence error, because sealer has already print error itself. 5. Use logrus to print the final error. Signed-off-by: huaiyou <[email protected]>
Fix register plugin bug; Support ipv6 dual stack; TODO: seautil route need to support dual stack.
Fix nil pointer bug.
Signed-off-by: huaiyou <[email protected]>
Signed-off-by: huaiyou <[email protected]>
# Conflicts: # pkg/env/env.go
# Conflicts: # vendor/github.com/sealyun/lvscare/care/care.go # vendor/modules.txt
…6-dual # Conflicts: # apply/apply.go # apply/run.go # apply/scale.go # cmd/sealer/cmd/upgrade.go
Skip add existing node.
…6-dual # Conflicts: # cmd/sealer/cmd/root.go # vendor/github.com/sealyun/lvscare/care/care.go # vendor/modules.txt
Codecov Report
@@ Coverage Diff @@
## main #1537 +/- ##
==========================================
- Coverage 10.86% 10.80% -0.07%
==========================================
Files 88 88
Lines 8015 8060 +45
==========================================
Hits 871 871
- Misses 7037 7082 +45
Partials 107 107
Continue to review full report at Codecov.
|
The DCO check fails, because some commit is not signed, but when i rebase, many conflict occurs.. So, please ignore this check and continue REVIEW. |
apply/apply.go
Outdated
} | ||
} | ||
|
||
if hasBoth := hasIPV4 && hasIPV6; hasBoth { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if hasIPV4 && hasIPV6 {
blabla
}
…6-dual # Conflicts: # apply/apply.go # apply/run.go # apply/scale.go # utils/net/iputils_test.go
ImageManager: imgSvc, | ||
ClusterImageMounter: mounter, | ||
ImageStore: is, | ||
}, nil | ||
} | ||
|
||
func checkAllHostsSameFamily(nodeList []string) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the validate function, you could add them into validate.go . Actually It seems to have nothing to do with the main apply procedure. @VinceCui
pkg/cert/kube_certs.go
Outdated
if err != nil { | ||
return nil, err | ||
|
||
for _, cidr := range strings.Split(SvcCIDR, ",") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue, this should be validated at the very beginning part, or validation layer. It is not suggested that we validate this in the underlying implementation layer. Should use Defensive Programming
.
I have several suggestions here after review:
|
@allencloud |
ignore Port-10250 in kubeadm
…ow a warning. Fix bug, a node slice should be nil if arg --masters or --workers is empty.
Signed-off-by: huaiyou <[email protected]>
Signed-off-by: huaiyou <[email protected]>
apply/applydriver/local.go
Outdated
@@ -49,6 +49,7 @@ type Applier struct { | |||
Client *k8s.Client | |||
ImageStore store.ImageStore | |||
CurrentClusterInfo *version.Info | |||
Action string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am afraid that I do not agree that passing a cmd layer type into an underlying procedure, here is the Applier struct. It makes me feel a bottom struct relies on the upper struct.
Ignore DirAvailable--etc-kubernetes-manifests when join; Explicitly specify the list of nodes to be deleted and to be added; Signed-off-by: huaiyou <[email protected]>
InitMaser115Upper = `kubeadm init --config=%s/etc/kubeadm.yml --upload-certs` | ||
JoinMaster115Upper = "kubeadm join --config=%s/etc/kubeadm.yml" | ||
JoinNode115Upper = "kubeadm join --config=%s/etc/kubeadm.yml" | ||
RemoveKubeConfig = "rm -rf /usr/bin/kube* && rm -rf ~/.kube/" | ||
RemoteCleanMasterOrNode = `if which kubeadm;then kubeadm reset -f %s;fi && \ | ||
RemoteCleanMasterOrNode = `systemctl restart docker kubelet;if which kubeadm;then kubeadm reset -f %s;fi && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the delete operation have to restart the service instead of stopping the service?
if err := mergo.Merge(&host.SSH, &cluster.Spec.SSH); err != nil { | ||
return nil, err | ||
if host.SSH.Pk != "" || host.SSH.Passwd != "" { | ||
return NewSSHClient(&host.SSH, false), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false --> isStdout
return nil, err | ||
} | ||
return NewSSHClient(&host.SSH, true), nil | ||
return NewSSHClient(&cluster.Spec.SSH, false), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false --> isStdout
} | ||
} | ||
} | ||
if cluster.Spec.SSH.Pk != "" || cluster.Spec.SSH.Passwd != "" { | ||
return NewSSHClient(&cluster.Spec.SSH, false), nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false --> isStdout
if len(newSlice) == 0 { | ||
// Sanitize for unit tests so we don't need to distinguish empty array | ||
// and nil. | ||
newSlice = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return nil is better?
@@ -306,10 +307,10 @@ func (k *KubeadmRuntime) Command(version string, name CommandType) (cmd string) | |||
return fmt.Sprintf("%s%s%s", v, vlogToStr(k.Vlog), " --ignore-preflight-errors=all") | |||
} | |||
if name == InitMaster || name == JoinMaster { | |||
return fmt.Sprintf("%s%s%s", v, vlogToStr(k.Vlog), " --ignore-preflight-errors=SystemVerification") | |||
return fmt.Sprintf("%s%s%s", v, vlogToStr(k.Vlog), " --ignore-preflight-errors=SystemVerification,Port-10250,DirAvailable--etc-kubernetes-manifests") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If kubelet is not started, port 10250 does not need to be ignored
Describe what this PR does / why we need it
支持ipv6双栈模式、ipv6only模式的部署,以扩展Sealer应对的场景
Does this pull request fix one issue?
fixes #1415
Describe how you did it
Describe how to verify it
Special notes for reviews