How to connect to minikube exposed Nodeport from other computers

11/29/2019

I am trying to expose one of my applications running on minikube to outer world. I have already used a Nodeport and I can access the application within the same hist machine using a web browser.

But I need to expose this application to one of my friends who is living somewhere far, so he can see it in his browser too.

This is how my deployment.yaml files look like, should I use an Ingress or how can I do this using an ingress ?

apiVersion: apps/v1
kind: Deployment
metadata:
        name: node-web-app
spec:
  replicas: 2
  selector:
    matchLabels:
            name: node-web-app
  template:
    metadata:
      labels:
        # you can specify any labels you want here
              name: node-web-app
    spec:
      containers:
      - name: node-web-app
        # image must be the same as you built before (name:tag)
        image: banuka/node-web-app
        ports:
        - name: http
          containerPort: 8080
          protocol: TCP
        imagePullPolicy: Never
      terminationGracePeriodSeconds: 60

How can I expose this deployment which is running a nodejs server to outside world?

-- BhagyaKolitha Jayalath
docker
kubernetes
kubernetes-ingress
yaml

2 Answers

11/30/2019

You can use ngrok. For example

ngrok http 8000

This will generate piblicly accessable url.

-- tefozi
Source: StackOverflow

11/29/2019

You generally can’t. The networking is set up only for the host machine. You could probably use ngrok or something though?

-- coderanger
Source: StackOverflow