skip to Main Content

How do I expose an ingress when running kubernetes with minikube in windows 10?

I have enabled the minikube ingress add on.

My ingress is running here…

NAME               CLASS   HOSTS           ADDRESS        PORTS   AGE
helmtest-ingress   nginx   helmtest.info   192.168.49.2   80      37m

I have added my hosts entry…

192.168.49.2 helmtest.info

I just get nothing when attempting to browse or ping either 192.168.49.2 or helmtest.info

My ingress looks like the following

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: helmtest-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
    - host: helmtest.info
      http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: helmtest-service
                port:
                  number: 80

My service looks like the following…

apiVersion: v1
kind: Service
metadata:
  name: helmtest-service
  labels: 
    app: helmtest-service
spec:
  type: ClusterIP
  selector:
    app: helmtest
  ports:
  - port: 80
    targetPort: 80
    protocol: TCP

I can access my service successfully in the browser after running minikube service helmtest-service --url

If I run minikube tunnel it just hangs here….

minikube tunnel
❗  Access to ports below 1024 may fail on Windows with OpenSSH clients older than v8.1. For more information, see: https://minikube.sigs.k8s.io/docs/handbook/accessing/#access-to-ports-1024-on-windows-requires-root-permission
🏃  Starting tunnel for service helmtest-ingress.

Where am I going wrong here?

2

Answers


  1. OP didn’t provide further information so I will provide answer based on the current information.

    You can run Ingress on Minikube using the $ minikube addons enable ingress command. However, ingress has more addons, like Ingress DNS using minikube addons enabled ingress-dns. In Minikube documentation you can find more details about this addon and when you should use it.

    Minikube has quite a well described section about tunnel. Quite important fact about the tunnel is that it must be run in a separate terminal window to keep the LoadBalancer running.

    Services of type LoadBalancer can be exposed via the minikube tunnel command. It must be run in a separate terminal window to keep the LoadBalancer running. Ctrl-C in the terminal can be used to terminate the process at which time the network routes will be cleaned up.

    This part is described in Accessing apps documentation.

    As OP mention

    I can access my service successfully in the browser after running minikube service helmtest-service –url

    If I run minikube tunnel it just hangs here….

    Possible Solution

    • You might use the old version of SSH, update it.
    • You are using ports <1024. This situation it’s described in this known issue part. Try to use higher port like 5000 like in this example
    • It might look like it just hangs, but you need a separate terminal window. Maybe it works correctly but you have to use another terminal

    Useful links

    Login or Signup to reply.
  2. It might be the host file missing minikube ip address with your host name. If ingress cannot resolve the hostname you set in yaml file it just stays in the schedule to sync phase

    Similar answer

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search