You can use the IP of Hyper-V External switch
created for minikube connection rendering.
- Open your
Hyper-V manager
and check the name of External virtual
switch
. In this guide it's called "Primary Virtual Switch".
- Check the IP address for this
Hyper-V
network interface on your
Windows 10 machine.
- Try to use this IP address in your minikube project for
communication purposes with a service residing on the local
machine.
I've used busybox
Pod and tested it on my machine:
apiVersion: v1
kind: Pod
metadata:
name: busybox
namespace: default
spec:
containers:
- image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
name: busybox
restartPolicy: Always
I was able to ping target local machine from the Pod's container:
kubectl exec -ti busybox -- ping XXX.XX.XX.XX