Unable to access kubernetes service on localhost with Docker for Windows

0 votes

I’m using Windows 10 Pro and Docker for Windows with kubernetes running:

I used the  kubectl create -f, command to create rc.yml:

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

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

This should host the service on localhost, but for some reason it's not happening.

Nov 15, 2018 in DevOps & Agile by Tyrion anex
• 8,270 points
183 views

1 answer to this question.

0 votes

Two ways to expose a service from a Kubernetes cluster:

  1. type: LoadBalancer.
  2. type: NodePort.
answered Nov 15, 2018 by Sophie may
• 9,850 points

Related Questions In DevOps & Agile

0 votes
1 answer

Docker for windows error: can’t access service on exposed port in windows container mode

You can try the following: Access container from different ...READ MORE

answered Dec 12, 2018 in DevOps & Agile by Tyrion anex
• 8,270 points
456 views
0 votes
1 answer
0 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 56,900 points
193 views
0 votes
1 answer

Error: Unable to access elasticsearch in docker for windows

This is simple, just follow the below ...READ MORE

answered Sep 3, 2018 in DevOps & Agile by Sophie may
• 9,850 points
59 views
0 votes
1 answer