<p>I have Windows 10 Pro with Docker for Windows v18.06.1-ce with kubernetes enabled.</p>

<p>Using <code>kubectl create -f</code>, I've created rc.yml:</p>

<pre><code>apiVersion: v1
kind: ReplicationController
metadata:
  name: hello-rc
spec:
  replicas: 9
  selector:
    app: hello-world
  template:
    metadata:
      labels:
        app: hello-world
    spec:
      containers:
      - name: hello-ctr
        image: nigelpoulton/pluralsight-docker-ci:latest
        ports:
        - containerPort: 8080
</code></pre>

<p>svc.yml</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: hello-svc
  labels:
    app: hello-world
spec:
  type: NodePort
  ports:
  - port: 8080
    nodePort: 30001
    protocol: TCP
  selector:
    app: hello-world
</code></pre>

<h1>How do I access the website behind the service?</h1>

<p>I would expect localhost:8080 to be working, but it isn't, nor is 10.108.96.27:8080</p>

<pre><code>&gt; kubectl describe service/hello-svc
Name:                     hello-svc
Namespace:                default
Labels:                   app=hello-world
Annotations:              &lt;none&gt;
Selector:                 app=hello-world
Type:                     NodePort
IP:                       10.108.96.27
LoadBalancer Ingress:     localhost
Port:                     &lt;unset&gt;  8080/TCP
TargetPort:               8080/TCP
NodePort:                 &lt;unset&gt;  30001/TCP
Endpoints:                10.1.0.10:8080,10.1.0.11:8080,10.1.0.12:8080 + 6 more...
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   &lt;none&gt;
</code></pre>

<p>There are two ways to expose a service to the outer world from a Kubernetes cluster:</p>

<ol>
<li><p>type: <strong>LoadBalancer</strong>. However, it works only with cloud providers.</p></li>
<li><p>type: <strong>NodePort</strong>. As you used in this case. Now, to access service inside Kubernetes cluster, you need to use the IP address of one of your Nodes and the port from the field <code>nodePort</code>
For example, <code>12.34.56.78:30001</code></p></li>
</ol>

<p>For more information, look through the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types" rel="noreferrer">official documentation</a>.</p>
