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

Use profile name as cluster/node name #6200

Merged
merged 12 commits into from
Feb 5, 2020
Merged

Conversation

laozc
Copy link
Contributor

@laozc laozc commented Jan 3, 2020

The node name is always minikube nowadays and this PR allows user to pick up one with --node-name.
If not specified, the node will be named minikube for the default profile name (minikube) or [PROFILE]-minikube.
For none driver the default node name will be set to the host name.

fixes #2800 #4063

Signed-off-by: Zhongcheng Lao <Zhongcheng.Lao@microsoft.com>
Signed-off-by: Zhongcheng Lao <Zhongcheng.Lao@microsoft.com>
Signed-off-by: Zhongcheng Lao <Zhongcheng.Lao@microsoft.com>
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 3, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @laozc. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 3, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: laozc
To complete the pull request process, please assign priyawadhwa
You can assign the PR to them by writing /assign @priyawadhwa in a comment when ready.

The full list of commands accepted by this bot can be found 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

@codecov-io
Copy link

codecov-io commented Jan 3, 2020

Codecov Report

Merging #6200 into master will decrease coverage by 0.41%.
The diff coverage is 26.57%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6200      +/-   ##
==========================================
- Coverage   38.38%   37.97%   -0.42%     
==========================================
  Files         124      128       +4     
  Lines        8378     8722     +344     
==========================================
+ Hits         3216     3312      +96     
- Misses       4739     4983     +244     
- Partials      423      427       +4
Impacted Files Coverage Δ
cmd/minikube/cmd/mount.go 8.33% <ø> (ø) ⬆️
pkg/minikube/out/style.go 91.66% <ø> (ø) ⬆️
pkg/minikube/bootstrapper/bootstrapper.go 0% <ø> (ø) ⬆️
pkg/minikube/driver/driver.go 71.83% <ø> (+1.96%) ⬆️
pkg/minikube/command/exec_runner.go 0% <ø> (ø) ⬆️
pkg/minikube/bootstrapper/bsutil/files.go 0% <ø> (ø) ⬆️
cmd/minikube/cmd/config/profile_list.go 3.94% <0%> (-0.17%) ⬇️
cmd/minikube/cmd/kubectl.go 0% <0%> (ø) ⬆️
pkg/minikube/assets/addons.go 36.06% <0%> (-1.87%) ⬇️
cmd/minikube/cmd/service.go 17.94% <0%> (-0.48%) ⬇️
... and 43 more

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

Thank you for this PR ! and this is a good idea !
two thigns
1- please use profile name as node name
2- please make sure the kubeadm config templates also receive the node name.

cmd/minikube/cmd/start.go Outdated Show resolved Hide resolved
cmd/minikube/cmd/start.go Outdated Show resolved Hide resolved
@RA489
Copy link

RA489 commented Jan 8, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2020
@minikube-bot
Copy link
Collaborator

All Times minikube: [ 124.025748 131.830177 125.899917]
All Times Minikube (PR 6200): [ 127.337378 129.701776 114.584535]

Average minikube: 127.251947
Average Minikube (PR 6200): 123.874563

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6200) |
+----------------------+-----------+--------------------+
| minikube v           |  0.499594 |           0.443831 |
| Creating kvm2        | 49.385835 |          46.897538 |
| Preparing Kubernetes | 51.015655 |          49.806792 |
| Pulling images       |  2.481664 |           2.718491 |
| Launching Kubernetes | 21.223641 |          21.188388 |
| Waiting for cluster  |  2.595839 |           2.770670 |
| Done                 |           |                    |
|                      |  0.049720 |           0.050935 |
+----------------------+-----------+--------------------+

Signed-off-by: Zhongcheng Lao <Zhongcheng.Lao@microsoft.com>
@minikube-bot
Copy link
Collaborator

All Times minikube: [ 123.943295 125.486914 125.486131]
All Times Minikube (PR 6200): [ 126.939861 125.606691 116.104350]

Average minikube: 124.972113
Average Minikube (PR 6200): 122.883634

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6200) |
+----------------------+-----------+--------------------+
| minikube v           |  0.467166 |           0.454020 |
| Creating kvm2        | 47.348030 |          47.525562 |
| Preparing Kubernetes | 51.080303 |          48.437225 |
| Pulling images       |  2.971338 |           3.120465 |
| Launching Kubernetes | 20.303665 |          20.545213 |
| Waiting for cluster  |  2.753121 |           2.751876 |
| Done                 |           |                    |
|                      |  0.048363 |           0.045304 |
+----------------------+-----------+--------------------+

@laozc laozc changed the title Allow user to specify node name Use profile name as node name Jan 8, 2020
Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

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

we also need to change the "clusterName: kubernetes" in the config template files
for example this one
https://github.com/kubernetes/minikube/blob/master/pkg/minikube/bootstrapper/bsutil/template/template.go#L80

make sure to change for all versions v1alpha, beta...

@@ -907,6 +907,17 @@ func generateCfgFromFlags(cmd *cobra.Command, k8sVersion string, drvName string)
out.T(out.SuccessType, "Using image repository {{.name}}", out.V{"name": repository})
}

var kubeNodeName string
if drvName == driver.None {
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason that the none driver should not have the same node name as Profile name ?
I would rather we treat all drivers same way as much as possible.

so lets have the profile name for none driver unless there is a good reason for it that I dont know ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the none driver the host is created by the user not minikube. If we're not setting the default host name, it will result a different node name with the host.
This issue would not exist for other drivers as those drivers create the VM and set the host name.
We may need to ask user to set the profile name to keep the same behavior as other drivers which may be confusing.

@medyagh medyagh changed the title Use profile name as node name Use profile name as cluster/node name Jan 8, 2020
@medyagh medyagh changed the title Use profile name as cluster/node name wip: Use profile name as cluster/node name Jan 8, 2020
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 8, 2020
@laozc
Copy link
Contributor Author

laozc commented Jan 9, 2020

we also need to change the "clusterName: kubernetes" in the config template files
for example this one
https://github.com/kubernetes/minikube/blob/master/pkg/minikube/bootstrapper/bsutil/template/template.go#L80

make sure to change for all versions v1alpha, beta...

Let me work on it.

Signed-off-by: Zhongcheng Lao <Zhongcheng.Lao@microsoft.com>
Signed-off-by: Zhongcheng Lao <Zhongcheng.Lao@microsoft.com>
@minikube-bot
Copy link
Collaborator

All Times minikube: [ 122.312750 126.452668 128.741744]
All Times Minikube (PR 6200): [ 128.445923 125.514681 127.103730]

Average Minikube (PR 6200): 127.021444
Average minikube: 125.835720

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6200) |
+----------------------+-----------+--------------------+
| minikube v           |  0.517005 |           0.517984 |
| Creating kvm2        | 47.714099 |          47.615632 |
| Preparing Kubernetes | 50.474336 |          51.585890 |
| Pulling images       |  3.125711 |           3.069604 |
| Launching Kubernetes | 21.145112 |          21.102278 |
| Waiting for cluster  |  2.809713 |           3.080203 |
| Done                 |           |                    |
|                      |  0.049744 |           0.047879 |
+----------------------+-----------+--------------------+

@minikube-pr-bot
Copy link

All Times minikube: [ 230.471049 231.896780 255.411575]
All Times Minikube (PR 6200): [ 133.603658 131.999431 129.485016]

Average minikube: 239.259802
Average Minikube (PR 6200): 131.696035

Averages Time Per Log

+----------------------+------------+--------------------+
|         LOG          |  MINIKUBE  | MINIKUBE (PR 6200) |
+----------------------+------------+--------------------+
| minikube v           |   0.330490 |           0.490987 |
| Creating kvm2        | 165.055304 |          49.438031 |
| Preparing Kubernetes |  42.719826 |          52.327345 |
| Pulling images       |   3.093997 |           2.861671 |
| Launching Kubernetes |  25.124011 |          21.960791 |
| Waiting for cluster  |   2.408452 |           2.589912 |
+----------------------+------------+--------------------+

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 18, 2020
@minikube-pr-bot
Copy link

All Times minikube: [ 115.674457 114.736020 113.975103]
All Times Minikube (PR 6200): [ 246.228137 244.239141 223.489306]

Average minikube: 114.795194
Average Minikube (PR 6200): 237.985528

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6200) |
+----------------------+-----------+--------------------+
| minikube v           |  0.293279 |           0.295391 |
| Creating kvm2        | 41.204637 |         160.882943 |
| Preparing Kubernetes | 47.127649 |          41.354905 |
| Pulling images       |  3.579486 |           2.528940 |
| Launching Kubernetes | 19.648309 |          30.318637 |
| Waiting for cluster  |  2.888949 |           2.554120 |
+----------------------+-----------+--------------------+

@medyagh
Copy link
Member

medyagh commented Feb 2, 2020

/retest-this-please

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 2, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 3, 2020
@laozc laozc changed the title wip: Use profile name as cluster/node name Use profile name as cluster/node name Feb 3, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 3, 2020
Signed-off-by: Zhongcheng Lao <Zhongcheng.Lao@microsoft.com>
@minikube-pr-bot
Copy link

All Times minikube: [ 96.419035 97.156901 95.234201]
All Times Minikube (PR 6200): [ 248.164132 249.146323 230.991058]

Average minikube: 96.270046
Average Minikube (PR 6200): 242.767171

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6200) |
+----------------------+-----------+--------------------+
| minikube v           |  0.312811 |           0.289210 |
| Creating kvm2        | 19.591671 |         160.905856 |
| Preparing Kubernetes | 49.344328 |          42.566592 |
| Pulling images       |  3.671491 |           2.145264 |
| Launching Kubernetes | 20.317207 |          32.102551 |
| Waiting for cluster  |  1.065767 |           2.725942 |
+----------------------+-----------+--------------------+

@minikube-pr-bot
Copy link

All Times minikube: [ 95.112039 96.441117 99.449515]
All Times Minikube (PR 6200): [ 95.511743 100.262568 97.791517]

Average Minikube (PR 6200): 97.855276
Average minikube: 97.000891

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6200) |
+----------------------+-----------+--------------------+
| minikube v           |  0.318202 |           0.314049 |
| Creating kvm2        | 20.270194 |          20.131254 |
| Preparing Kubernetes | 49.847239 |          50.782450 |
| Pulling images       |  3.196627 |           2.979757 |
| Launching Kubernetes | 19.858326 |          20.594995 |
| Waiting for cluster  |  1.387860 |           1.060559 |
+----------------------+-----------+--------------------+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

running minikube with --bootstrapper=kubeadm uses minikube as the hard-coded node name
8 participants