<p>I have a minikube cluster running on Mac OSX and a simple Spring Boot REST api that connects to Redis and Mongo DB, which I have installed and running locally.  </p>

<p>I wish not to run Redis / MongoDb in a Docker container.<br>
I will probably run them remotely in the cloud, therefore I would probably just connect to an external IP address.  </p>

<p>What I don't understand is what IP address I should use to connect to my localhost machine.<br>
I start up my Minikube with VM hyperkit. </p>

<p>Edit: 
I also tried to start using virtualbox: </p>

<pre><code>minikube start --vm-driver=virtualbox
</code></pre>

<p>In my spring boot application, I've configured: </p>

<pre><code>spring.data.mongodb.host = 10.0.2.2 
spring.redis.host = 10.0.2.2 
</code></pre>

<p>But still, I get connection errors: </p>

<p><a href="https://i.stack.imgur.com/JzaIZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JzaIZ.png" alt="enter image description here"></a></p>

<p><a href="https://i.stack.imgur.com/QuFcr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QuFcr.png" alt="enter image description here"></a></p>

<p>This works when I run the application locally on my host machine. </p>

<p>For the sake of completeness, this is my yaml file: </p>

<pre><code>---
apiVersion: v1
kind: Service
metadata:
  name: posts-api
  labels:
    app: posts-api
    env: dev
spec:
  type: NodePort
  selector:
    app: posts-api
  ports:
  - protocol: TCP
    port: 8083
    name: http

---
apiVersion: v1
kind: ReplicationController
metadata:
  name: posts-api
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: posts-api
    spec:
      containers:
      - name: posts-api
        image: kimgysen/posts-api:latest
        ports:
        - containerPort: 8083
        livenessProbe:
          httpGet:
            path: /health
            port: 8083
          initialDelaySeconds: 120
          timeoutSeconds: 3
</code></pre>

html_programmer
<p>I'll give you the answer I gave to someone with the same problem (different tech):</p>

<p><a href="https://stackoverflow.com/questions/53433440/kubernetes-pod-unable-to-connect-to-rabbit-mq-instance-running-locally/53449625#53449625">Kubernetes pod unable to connect to rabbit mq instance running locally</a></p>

<p>Replace the IP and port number, and the Service and Endpoints names as appropriate.</p>
