<p><strong>replicationcontroller.yml</strong></p>

<pre><code>apiVersion: v1
kind: ReplicationController
metadata:
  name: nginx
spec:
  replicas: 3
  selector:
    app: nginx
  template:
    metadata:
      name: nginx
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx
        ports:
        - containerPort: 80
</code></pre>

<p><strong>nginx-service.yml</strong></p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  type: NodePort
  selector:
    app: nginx
  ports:
    - protocol: TCP
      port: 80
</code></pre>

<p><strong>Commands:</strong></p>

<ol>
<li>kubectl create -f replicationcontroller.yml</li>
<li>kubectl create -f nginx-service.yml</li>
</ol>

<p><a href="https://i.stack.imgur.com/EL1vD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EL1vD.png" alt="Kubernetes status"></a>
<a href="https://i.stack.imgur.com/Cr6Yr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Cr6Yr.png" alt="Not reachable via host system on port 31078"></a></p>

Abhishek
<p>I can't reproduce your error; the manifest works for me.</p>

<p>However, if you're using Minikube, you should be aware that Minikube has it's own virtual machine with IP address. Please try:</p>

<pre><code>curl $(minikube ip):31078
</code></pre>
