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,280 points
67 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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,050 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,280 points
197 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,120 points
56 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,050 points
25 views
0 votes
1 answer

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.