<p>hope you all well!</p>

<p>I need to see my app on the browser but I believe that I'm missing something here and hope you can help me with this.</p>

<pre><code>[root@kubernetes Docker]# kubectl get all
NAME                           READY   STATUS    RESTARTS   AGE
pod/my-app2-56d5c786dd-n7mqq   1/1     Running   0          19m
pod/nginx-86c57db685-bxkpl     1/1     Running   0          13h

NAME                 TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)        AGE
service/kubernetes   ClusterIP   10.96.0.1        &lt;none&gt;        443/TCP        31h
service/my-app2      ClusterIP   10.101.108.199   &lt;none&gt;        8085/TCP       12m
service/nginx        NodePort    10.106.14.144    &lt;none&gt;        80:30525/TCP   13h

NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/my-app2   1/1     1            1           19m
deployment.apps/nginx     1/1     1            1           13h

NAME                                 DESIRED   CURRENT   READY   AGE
replicaset.apps/my-app2-56d5c786dd   1         1         1       19m
replicaset.apps/nginx-86c57db685     1         1         1       13h
</code></pre>

<p>Overall you can see that everything is working fine right, looks the same to me.</p>

<p>To open this on my browser I'm using my IP address from Slave node where the container is allocated.
On my app I'm mapping the Hello like this @RequestMapping("/Hello")
On my dockerfile to build my image i used this:</p>

<pre><code>[root@kubernetes project]# cat Dockerfile
FROM openjdk:8
COPY microservico-0.0.1-SNAPSHOT.jar microservico-0.0.1-SNAPSHOT.jar
#WORKDIR /usr/src/microservico-0.0.1-SNAPSHOT.jar
EXPOSE 8085
ENTRYPOINT ["java", "-jar", "microservico-0.0.1-SNAPSHOT.jar"]
</code></pre>

<p>So at the end, I think I need to call for my app this way.</p>

<p>---> ip:8085/Hello</p>

<pre><code>[root@kubernetes project]# telnet kubeslave 8085
Trying 192.168.***.***...
telnet: connect to address 192.168.***.***: Connection refused
</code></pre>

<p>but I still see nothing...</p>

<p>Here is my deploy and service:</p>

<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app2
  labels:
    app: app
spec:
  selector:
    matchLabels:
      app: app
      role: master
      tier: backend
  replicas: 1
  template:
    metadata:
      labels:
        app: app
        role: master
        tier: backend
    spec:
      containers:
      - name: appcontainer
        image: *****this is ok*****:my-java-app
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 8085


apiVersion: v1
kind: Service
metadata:
  name: my-app2
  labels:
    app: app
    role: master
    tier: backend
spec:
  ports:
  - port: 8085
    targetPort: 8085
  selector:
    app: app
    role: master
    tier: backend
</code></pre>

Bedjase
<p>You have create a service which is of type ClusterIP(default). This type of service is only for accessing from inside the kubernetes cluster.For accessing it from browser you need to expose the pod via <a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">LoadBalancer</a> or <a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer">Nodeport</a> service. LoadBalancer only works if you are one of supported public cloud otherwise Nodeport need to be used.</p>

<p><a href="https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/stateless-application/expose-external-ip-address/</a></p>

<p><a href="https://kubernetes.io/docs/tasks/access-application-cluster/service-access-application-cluster/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/access-application-cluster/service-access-application-cluster/</a></p>

<p>Other than using service you can use kubectl proxy to access it as well.</p>

<p>If you are on Minikube then follow this</p>

<p><a href="https://kubernetes.io/docs/tutorials/hello-minikube/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/hello-minikube/</a></p>
