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

Minikube Can't Curl IP v0.33.1 / MacOS with Traefik #3677

Closed
patientplatypus opened this issue Feb 14, 2019 · 7 comments
Closed

Minikube Can't Curl IP v0.33.1 / MacOS with Traefik #3677

patientplatypus opened this issue Feb 14, 2019 · 7 comments

Comments

@patientplatypus
Copy link

This is a bug.

I've attempted to start up minikube and curl the IP that is outputted and get a connection refused:

patientplatypus:~/Documents/HomePage:15:42:29$minikube start
Starting local Kubernetes v1.13.2 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Stopping extra container runtimes...
Starting cluster components...
Verifying kubelet health ...
Verifying apiserver health ...
Kubectl is now configured to use the cluster.
Loading cached images from config file.


Everything looks great. Please enjoy minikube!
patientplatypus:~/Documents/HomePage:15:44:37$minikube ip
192.168.99.114
patientplatypus:~/Documents/HomePage:15:44:56$curl $(minikube ip)
curl: (7) Failed to connect to 192.168.99.114 port 80: Connection refused
@afbjorklund
Copy link
Collaborator

What was supposed to listen on port 80 ? The kubernetes master is now using HTTPS (8443)

Normally you don't curl to it, but using something like kubectl or dashboard (or a service)

@patientplatypus
Copy link
Author

So I am trying to use traefik (see here: https://docs.traefik.io/user-guide/kubernetes/). Basically when I get to the point where I want to curl ${minikube ip} the examples die (most likely as you have said because minikube is now targetting :8443). I've gone ahead and confirmed:

patientplatypus:~/Documents/HomePage:16:55:49$nmap 192.168.99.116 -Pn
Starting Nmap 7.70 ( https://nmap.org ) at 2019-02-14 16:55 CST
Nmap scan report for 192.168.99.116
Host is up (0.0029s latency).
Not shown: 996 filtered ports
PORT     STATE SERVICE
22/tcp   open  ssh
111/tcp  open  rpcbind
2049/tcp open  nfs
8443/tcp open  https-alt

Nmap done: 1 IP address (1 host up) scanned in 5.93 seconds

However, going through and changing the ports in the example files from 80 to 8443 doesn't allow them to work. I'm going to file a bug report over there if this is now how minikube is supposed to work.

@patientplatypus
Copy link
Author

OK...I have to admit that at this point I'm lost. I want to create an Ingress controller and there are no examples that I can find that don't use port 80. Here is another one: https://github.com/nginxinc/kubernetes-ingress/blob/master/docs/installation.md. If I change the file https://github.com/nginxinc/kubernetes-ingress/blob/master/deployments/deployment/nginx-ingress.yaml from having the lines:

spec:
      serviceAccountName: nginx-ingress
      containers:
      - image: nginx/nginx-ingress:edge
        imagePullPolicy: Always
        name: nginx-ingress
        ports:
        - name: http
           containerPort: 80
        - name: https
          containerPort: 443

to having the lines

spec:
      serviceAccountName: nginx-ingress
      containers:
      - image: nginx/nginx-ingress:edge
        imagePullPolicy: Always
        name: nginx-ingress
        ports:
        - name: https
          containerPort: 8443

Then I get crashes and loopback errors. As I haven't configured an ingress controller before, and all examples that use port 80 appear to be broken and I can't seem to fix them using the new https port 8443, I'm stuck. This change in minikube seems to have caused a breaking change to everything that used to use it.

Is there an example of an Ingress controller that works using only port 8443?

@afbjorklund
Copy link
Collaborator

Well, if you deploy a DaemonSet that listens on port 80 that is different...
As I tried to explain, the 8443 is only used to contact the master (API)

Most likely this is the same bug as #3416, where we default to wrong IP.
You should not use 8443, since that will conflict with the kubernetes master.

@afbjorklund afbjorklund changed the title Minikube Can't Curl IP v0.33.1 / MacOS Minikube Can't Curl IP v0.33.1 / MacOS with Traefik Feb 15, 2019
@afbjorklund
Copy link
Collaborator

Anyway, the example shown on their page works fine on a regular Linux deployment...

$ kubectl apply -f https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-rbac.yaml
clusterrole.rbac.authorization.k8s.io "traefik-ingress-controller" created
clusterrolebinding.rbac.authorization.k8s.io "traefik-ingress-controller" created
$ kubectl apply -f https://raw.githubusercontent.com/containous/traefik/master/examples/k8s/traefik-ds.yaml
serviceaccount "traefik-ingress-controller" created
daemonset.extensions "traefik-ingress-controller" created
service "traefik-ingress-service" created
$ curl $(minikube ip)
404 page not found

You forgot to fill in the template which minikube version and drivers that you are using.

@patientplatypus
Copy link
Author

Ah, I am so sorry. The issue was in fact my fault - I was improperly configuring traefik (it turns out that using the daemonset was the preferred way) - and I was getting frustrated. Thanks for the help!

@cpxPratik
Copy link

cpxPratik commented May 29, 2019

Update: I was running minikube with minikube start -p vb_test --vm-driver=virtualbox and always do minikube stop -p vb_test and minikube delete -p vb_test. After doing rm -rf ~/.minikube and then just minikube start, the issue is gone. It seems with minikube profile -p flag, the issue occurs.

Initial: Using daemonset does not work. Basically deploying Traefik using both Deployment and DaemonSet does not work at all. I have checked with describe command for service and pods, can not fine anything out of place. Should I create a new issue on traefik repo?

https://docs.traefik.io/user-guide/kubernetes/

kubectl apply -f https://raw.githubusercontent.com/containous/traefik/v1.7/examples/k8s/traefik-rbac.yaml
clusterrole.rbac.authorization.k8s.io/traefik-ingress-controller created
clusterrolebinding.rbac.authorization.k8s.io/traefik-ingress-controller created

kubectl apply -f https://raw.githubusercontent.com/containous/traefik/v1.7/examples/k8s/traefik-ds.yaml
serviceaccount/traefik-ingress-controller created
daemonset.extensions/traefik-ingress-controller created

curl $(minikube ip)
curl: (7) Failed to connect to 192.168.2.123 port 80: Connection refused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants