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 a NodeName separate from the MachineName within the VM (continued) #2796

Merged
merged 3 commits into from Jun 18, 2018

Conversation

Projects
None yet
5 participants
@petertrotman
Contributor

petertrotman commented May 8, 2018

Continued from #2722 (changed the source branch from my fork).

Fix for #2717

Summary:

The kubelets are hard-coded to look for a node called minikube. However, currently the NodeName is set to be the MachineName which is set to the profile name. This means that when the profile is not minikube, the cluster fails to start.

This pull requests solves the issue by fixing the NodeName of the kubeadm node to minikube regardless of the profile.

An alternative solution is to remove the hostname-override completely so that the kubelets should also look for a node with the same name as the profile name. However, in this case, profile names with spaces cause the cluster to fail. A first pass at fixing the issue can be seen here: https://github.com/petertrotman/minikube/tree/hostname-override but more work needs to be done.

Next Steps:

Currently, profile functionality is completely broken due to this issue. I believe that simply setting the NodeName to minikube is a complete and fuss-free solution - I don't see any particular reason why the user cares about the cluster's internal NodeName. However, I am happy to do a bit of work to make removing hostname-override viable, if that is what the maintainers want. So I would like a decision of either 'yes this pull request will do' or 'no we need to do this by removing hostname-override so make that happen instead'.

@k8s-ci-robot

This comment has been minimized.

Show comment
Hide comment
@k8s-ci-robot

k8s-ci-robot May 8, 2018

Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: petertrotman
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: luxas

Assign the PR to them by writing /assign @luxas in a comment when ready.

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

Contributor

k8s-ci-robot commented May 8, 2018

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: petertrotman
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: luxas

Assign the PR to them by writing /assign @luxas in a comment when ready.

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

@k8s-ci-robot k8s-ci-robot added the size/XS label May 8, 2018

@petertrotman petertrotman changed the title from Explicit node name to Use a NodeName separate from the MachineName within the VM (continued) May 8, 2018

@minikube-bot

This comment has been minimized.

Show comment
Hide comment
@minikube-bot

minikube-bot May 8, 2018

Collaborator

Can one of the admins verify this patch?

Collaborator

minikube-bot commented May 8, 2018

Can one of the admins verify this patch?

@gintautassulskus

This comment has been minimized.

Show comment
Hide comment
@gintautassulskus

gintautassulskus May 25, 2018

I applied this patch to tags/v0.27.0 and have found that the minikube works with virtualbox driver but fails to initialise with hyperkit:

#minikube start --profile test-hyperkit --vm-driver hyperkit
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components... <--- stuck here

Within the minikube I can see a loop of error messages with the last one being failed to get node info: node "minikube" not found:

May 25 13:38:59 test-hyperkit kubelet[3079]: I0525 13:38:59.250256    3079 kubelet_node_status.go:271] Setting node annotation to enable volume controller attach/detach
May 25 13:38:59 test-hyperkit kubelet[3079]: E0525 13:38:59.891198    3079 reflector.go:205] k8s.io/kubernetes/pkg/kubelet/kubelet.go:451: Failed to list *v1.Service: Get https://192.168.64.30:8443/api/v1/services?limit=500&resourceVersion=0: dial tcp 192.168.64.30:8443: getsockopt: connection refused
May 25 13:38:59 test-hyperkit kubelet[3079]: E0525 13:38:59.891935    3079 reflector.go:205] k8s.io/kubernetes/pkg/kubelet/kubelet.go:460: Failed to list *v1.Node: Get https://192.168.64.30:8443/api/v1/nodes?fieldSelector=metadata.name%3Dminikube&limit=500&resourceVersion=0: dial tcp 192.168.64.30:8443: getsockopt: connection refused
May 25 13:38:59 test-hyperkit kubelet[3079]: E0525 13:38:59.893554    3079 reflector.go:205] k8s.io/kubernetes/pkg/kubelet/config/apiserver.go:47: Failed to list *v1.Pod: Get https://192.168.64.30:8443/api/v1/pods?fieldSelector=spec.nodeName%3Dminikube&limit=500&resourceVersion=0: dial tcp 192.168.64.30:8443: getsockopt: connection refused
May 25 13:39:00 test-hyperkit kubelet[3079]: E0525 13:39:00.428880    3079 eviction_manager.go:246] eviction manager: failed to get get summary stats: failed to get node info: node "minikube" not found

I haven't pinpointed the cause.

EDIT: My issue might be related to kubernetes/kubeadm#684 The issue started to occurr the next day after posting here.

gintautassulskus commented May 25, 2018

I applied this patch to tags/v0.27.0 and have found that the minikube works with virtualbox driver but fails to initialise with hyperkit:

#minikube start --profile test-hyperkit --vm-driver hyperkit
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components... <--- stuck here

Within the minikube I can see a loop of error messages with the last one being failed to get node info: node "minikube" not found:

May 25 13:38:59 test-hyperkit kubelet[3079]: I0525 13:38:59.250256    3079 kubelet_node_status.go:271] Setting node annotation to enable volume controller attach/detach
May 25 13:38:59 test-hyperkit kubelet[3079]: E0525 13:38:59.891198    3079 reflector.go:205] k8s.io/kubernetes/pkg/kubelet/kubelet.go:451: Failed to list *v1.Service: Get https://192.168.64.30:8443/api/v1/services?limit=500&resourceVersion=0: dial tcp 192.168.64.30:8443: getsockopt: connection refused
May 25 13:38:59 test-hyperkit kubelet[3079]: E0525 13:38:59.891935    3079 reflector.go:205] k8s.io/kubernetes/pkg/kubelet/kubelet.go:460: Failed to list *v1.Node: Get https://192.168.64.30:8443/api/v1/nodes?fieldSelector=metadata.name%3Dminikube&limit=500&resourceVersion=0: dial tcp 192.168.64.30:8443: getsockopt: connection refused
May 25 13:38:59 test-hyperkit kubelet[3079]: E0525 13:38:59.893554    3079 reflector.go:205] k8s.io/kubernetes/pkg/kubelet/config/apiserver.go:47: Failed to list *v1.Pod: Get https://192.168.64.30:8443/api/v1/pods?fieldSelector=spec.nodeName%3Dminikube&limit=500&resourceVersion=0: dial tcp 192.168.64.30:8443: getsockopt: connection refused
May 25 13:39:00 test-hyperkit kubelet[3079]: E0525 13:39:00.428880    3079 eviction_manager.go:246] eviction manager: failed to get get summary stats: failed to get node info: node "minikube" not found

I haven't pinpointed the cause.

EDIT: My issue might be related to kubernetes/kubeadm#684 The issue started to occurr the next day after posting here.

@dlorenc

This comment has been minimized.

Show comment
Hide comment
@dlorenc

dlorenc May 31, 2018

Contributor

@minikube-bot OK to test

Contributor

dlorenc commented May 31, 2018

@minikube-bot OK to test

@dlorenc

This comment has been minimized.

Show comment
Hide comment
@dlorenc

dlorenc May 31, 2018

Contributor

Looks like there's a gofmt error in travis.

Contributor

dlorenc commented May 31, 2018

Looks like there's a gofmt error in travis.

petertrotman and others added some commits Apr 13, 2018

Changed the nodes within the VM to use a NodeName variable that is
seperate from the VM Machine Name to ensure proper functionality when
using different profile names.
@dlorenc

This comment has been minimized.

Show comment
Hide comment
@dlorenc

dlorenc Jun 18, 2018

Contributor

I just fixed up the gofmt issue and rebased. This should fix #2717

Contributor

dlorenc commented Jun 18, 2018

I just fixed up the gofmt issue and rebased. This should fix #2717

@dlorenc dlorenc merged commit 2b0e10c into kubernetes:master Jun 18, 2018

8 of 14 checks passed

Linux-None Jenkins
Details
Minishift-Linux-KVM Jenkins
Details
Linux-Virtualbox Jenkins
Details
Windows-Kubeadm-CRI-O Jenkins
Details
Windows-Virtualbox Jenkins
Details
tide Not mergeable. Needs approved, lgtm labels.
Details
Jenkins Cross Build Build finished. No test results found.
Details
Linux-Container Jenkins
Details
Linux-KVM Jenkins
Details
Linux-VirtualBox Jenkins
Details
OSX-Hyperkit Jenkins
Details
OSX-Virtualbox Jenkins
Details
cla/linuxfoundation dlorenc authorized
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@petertrotman

This comment has been minimized.

Show comment
Hide comment
@petertrotman

petertrotman Jun 18, 2018

Contributor

Excellent, thank you @dlorenc.

Contributor

petertrotman commented Jun 18, 2018

Excellent, thank you @dlorenc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment