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,700 points
2,303 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
• 10,610 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,700 points
5,151 views
+2 votes
1 answer
+2 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
• 58,090 points
2,436 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
• 10,610 points
1,457 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP