-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Implement multi-node cluster capabilities #6787
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sharifelgamal 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 |
cmd/minikube/cmd/node_add.go
Outdated
@@ -47,16 +47,23 @@ var nodeAddCmd = &cobra.Command{ | |||
if nodeName == "" { | |||
name = profile + strconv.Itoa(len(mc.Nodes)+1) |
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.
while we are at it, why not rename all mc to cc and make sure we call it cc everywhere in the code
Codecov Report
@@ Coverage Diff @@
## master #6787 +/- ##
=======================================
Coverage 36.98% 36.98%
=======================================
Files 145 145
Lines 9161 9161
=======================================
Hits 3388 3388
Misses 5355 5355
Partials 418 418 |
cmd/minikube/cmd/ssh.go
Outdated
n, _, err = node.Retrieve(cc, nodeName) | ||
if err != nil { | ||
out.FailureT("Node {{.nodeName}} does not exist.", out.V{"nodeName": nodeName}) | ||
exit.WithError("", err) |
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.
Combine these two calls into one which generates the proper exit code:
exit.WithCodeT(exit.Unavailable, "node ... does not exist")
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.
done
cmd/minikube/cmd/start.go
Outdated
} | ||
if numNodes > 1 { | ||
if driver.BareMetal(driverName) { | ||
out.T(out.Meh, "The none driver is not compatible with multi-node clusters.") |
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.
Exit rather than ignoring the user:
exit.WithCodeT(exit.Config, "....")
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.
done
cmd/minikube/cmd/start.go
Outdated
out.T(out.Meh, "The none driver is not compatible with multi-node clusters.") | ||
} else { | ||
for i := 1; i < numNodes; i++ { | ||
nodeName := fmt.Sprintf("m%02d", i+1) |
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 noticed this formatting in two locations. Add a node.Name(int)
function?
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.
yep, added.
return "", errors.Wrap(err, "generating bootstrap token") | ||
} | ||
|
||
/*cp, err := config.PrimaryControlPlane(&cc) |
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.
Remove debugging comment
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.
done.
/ok-to-test |
All Times minikube: [ 65.822917 65.489519 64.712395] Average minikube: 65.341610 Averages Time Per Log
|
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 have a comment I would like to see fixed before release, but I'm OK with merging this PR to get miles on it.
Plumbing the name of the ContainerRuntime to configure into the provision library may require trickery, such as adding it to an unused field in say, SwarmOptions
. I look forward to your creative solution.
return fmt.Sprintf("%s---%s", cc.Name, n.Name) | ||
} | ||
|
||
// ClusterNameFromMachine retrieves the cluster name embedded in the machine name |
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 see pain and suffering on this path. Instead of adding structure to an unstructured field & calling config.Load outside of main, we should be passing the config object around.
All Times minikube: [ 69.090527 65.157437 64.588555] Average minikube: 66.278840 Averages Time Per Log
|
TestFunctional/parallel/SSHCmd failure is interesting and unexpected:
|
I have no idea why my change to ssh would cause a carriage return to get swallowed up |
Fixes #6505
Begins to address #94
You can spin up a multinode cluster in 2 ways:
You can spin up and down individual nodes by name:
Multi-node clusters are still experimental and won't be fully featured.
NOTE: This PR does not account for CNI, that will come in a subsequent PR. Currently, you will need to install CNI manually for multi-node to work properly.