<p>I've a simple HelloWorld ReactJs application Docker image and I created the deployment as:</p>
<pre><code>kind: Deployment
apiVersion: apps/v1
metadata:
  name: minikube-react-app
spec:
  replicas: 2
  selector:
    matchLabels:
      app: minikube-react-app
  template:
    metadata:
      labels:
        app: minikube-react-app
    spec:
      containers:
        - name: minikube-react-app
          image: hello-react:1.0.1
          imagePullPolicy: Never
          ports:
            - containerPort: 80
          resources:
            requests:
              memory: &quot;100Mi&quot;
              cpu: &quot;300m&quot;
            limits:
              memory: &quot;200Mi&quot;
              cpu: &quot;600m&quot;
      restartPolicy: Always
---
kind: Service
apiVersion: v1
metadata:
  name: minikube-react-app
spec:
  type: NodePort
  ports:
    - port: 80
      targetPort: 80
      protocol: TCP
      nodePort: 31000
  selector:
    app: minikube-react-app

</code></pre>
<p>I ran, kubectl apply -f deployent.yaml</p>
<p>But when I access http://localhost:31000 it's not working(This site can’t be reached).</p>
<p>Can someone help me with this please?</p>

Vasu Youth
<p>Should use 'node ip' instead of 'localhost' to acccess node port.</p>
<p>Run shell <code>minikube ip</code> to obtain ip of minikube node.</p>
<p>Check the service type: <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types</a></p>
