How to access web server running on host OS from inside a microk8s pod?

1/16/2020

I would like to have a web server running in a pod reaching a web server running on my host OS.

To do that i need to have the ip or dns of my host inside microk8s.

Is there any way to get it?

-- NoƩ
kubernetes
microk8s
networking

1 Answer

1/16/2020

You can use Downward API to get host IP details.

Example:

env:
   - name: NODE_IP
     valueFrom:
       fieldRef:
         fieldPath: status.hostIP
-- Shashank V
Source: StackOverflow