<p>I am trying to deploy simple spring boot REST service on minikube (Windows-10). Below are my configuration </p>

<p><strong>Docker file</strong>    </p>

<pre><code>FROM openjdk:8-jdk-alpine
ENTRYPOINT ["/usr/bin/java", "-jar", "/usr/share/myservice/minikube-spring-boot-demo-0.0.1-SNAPSHOT.jar"]
ADD target/minikube-spring-boot-demo-0.0.1-SNAPSHOT.jar  /usr/share/myservice/lib
ARG JAR_FILE
ADD target/${JAR_FILE} /usr/share/myservice/minikube-spring-boot-demo-0.0.1-SNAPSHOT.jar
EXPOSE 8080
</code></pre>

<p>docker image is running fine and i am able to run the app.</p>

<pre><code>docker run -p 8080:8080 minikube-spring-boot-demo:0.0.1-SNAPSHO
</code></pre>

<p><strong>Deployment</strong></p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: minikube-spring-boot-demo
spec:
  selector:
    matchLabels:
      app: minikube-spring-boot-demo
      tier: backend
  replicas: 3
  template:
    metadata:
      labels:
        app: minikube-spring-boot-demo
        tier: backend
    spec:
      containers:
        - name: demo-backend
          image: nirajsonawane/minikube-spring-boot-demo:0.0.1-SNAPSHOT
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
</code></pre>

<p><strong>Service</strong> </p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: minikube-spring-boot-demo-service
spec:
  selector:
    app: minikube-spring-boot-demo
    tier: backend
  ports:
    - port: 8080
      targetPort: 8080
      nodePort: 30008
  type: NodePort
</code></pre>

<p><strong>kubectl get all status</strong> 
<a href="https://i.stack.imgur.com/bfRGo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bfRGo.png" alt="enter image description here"></a></p>

<p><strong>kubectl cluster-info</strong>
<a href="https://i.stack.imgur.com/SfQoJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SfQoJ.png" alt="enter image description here"></a></p>

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

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

<p>i am not able to access the rest endpoint using <code>service-ip:Nodeport/Uri</code><br>
<strong><a href="http://127.0.0.1:30008/hello" rel="nofollow noreferrer">http://127.0.0.1:30008/hello</a></strong></p>

<p><strong><a href="http://172.17.0.2:30008/hello" rel="nofollow noreferrer">http://172.17.0.2:30008/hello</a></strong></p>

<p>Anything i am missing here? any inputs will be useful.</p>

<p>output of   <strong>netstat -a</strong></p>

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

Niraj Sonawane
<p><code>minikube</code> is running in a virtual machine. Services can't be accessed through either <code>localhost</code> or <code>127.0.0.1</code> out of the machine.</p>

<p>Try to run <code>minikube service minikube-spring-boot-demo-service</code>. It will show service details and open the service in the browser.</p>
