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

localkube (running only in http mode) throws healthcheck errors #2506

Closed
kmova opened this issue Feb 2, 2018 · 3 comments
Closed

localkube (running only in http mode) throws healthcheck errors #2506

kmova opened this issue Feb 2, 2018 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@kmova
Copy link
Contributor

kmova commented Feb 2, 2018

BUG REPORT

Environment:

minikube version: v0.25.0

OS:
  NAME="Ubuntu"
  VERSION="16.04.3 LTS (Xenial Xerus)"
  ID=ubuntu
  ID_LIKE=debian
  PRETTY_NAME="Ubuntu 16.04.3 LTS"
  VERSION_ID="16.04"
  HOME_URL="http://www.ubuntu.com/"
  SUPPORT_URL="http://help.ubuntu.com/"
  BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
  VERSION_CODENAME=xenial
  UBUNTU_CODENAME=xenial
VM driver:
  "DriverName": "none",

What happened:
I had a kubernetes cluster that uses insecure deployment (https://kubernetes.io/docs/getting-started-guides/scratch/#security-models), where API server is exposed via http. (No SSL). Some of the operator pods, that were using client-go, InClusterConfig option to communicate with the API server started failing. I wanted to reproduce this environment using minikube (vm-driver=none) so that I could test my changes to the operator without having to recreate the entire setup -- kubernetes the hardway!

Localkube has setting that can be used to apiserver in insecure(http) mode, using the following options:

--apiserver-insecure-address=0.0.0.0 
--apiserver-insecure-port=8080 
--apiserver-port=0 
--generate-kubeconfig=true

When the above changes are made and localkube is restarted, it starts to continuously throw the following error messages and also doesn;t schedule any pods:

Feb  2 09:53:10 kmova-minikube localkube[2570]: I0202 09:53:10.425450    2570 ready.go:30] Performing healthcheck on http://localhost:0/healthz
Feb  2 09:53:10 kmova-minikube localkube[2570]: E0202 09:53:10.425837    2570 ready.go:40] Error performing healthcheck: Get http://localhost:0/healthz: dial tcp 127.0.0.1:0: getsockopt: connection refused

What you expected to happen:
localkube should be functional in insecure only mode and user should be able to run their workloads.

How to reproduce it (as minimally and precisely as possible):

  • Start the minikube by following the instructions at https://github.com/kubernetes/minikube for the option of vm-driver=none.
  • Update /etc/systemd/system/localkube.service with the above mentioned insecure options.
  • Check the /var/log/syslog

Output of minikube logs (if applicable):

Anything else do we need to know:

The issue is related to the way pkg/localkube/apiserver.go uses the APIServerPort.

 func readyFunc(lk LocalkubeServer) HealthCheck {
        return healthCheck(lk.GetAPIServerProtocol()+path.Join(
               net.JoinHostPort("localhost", strconv.Itoa(lk.APIServerPort)), "healthz"), lk)
 }

Even when APIServerPort is set to 0 via the options, health check is performed on the same port.

@r2d4 r2d4 added kind/bug Categorizes issue or PR as related to a bug. bootstrapper/localkube labels Mar 5, 2018
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 3, 2018
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jul 3, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants