0

I am facing issue related to kubernetes service external Ip. It is showing as 'pending'. I created deployment of type Load Balancer. I am using docker-desktop.

Please find below my YAML for creating deployment-

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: load-balancer
  name: nginxdeployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: load-balancer
  template:
    metadata:
      labels:
        app: load-balancer
    spec:
      containers:
      - image: nginx
        name: nginxcontainer
        ports:
        - containerPort: 8080

Here is the command which I have used to expose my deployment- kubectl expose deployment nginxdeployment --type=LoadBalancer --name=nginxservice.

Below is the screenshot of exposed service in CLI- Kubernets CLI screenshot

As highlighted in yellow in above image, it is showing pending under external IP for load balancer Service.

Please help me how come I can resolve this issue. It should IP instead of pending.

Thank you in Advance!!!

Rahul
  • 21
  • 4
  • 1
    LoadBalancer-type services will generally only fill in the "external IP" field on public-cloud infrastructure or if you've set up a tool like MetalLB. For desktop-type installations a NodePort service is usually sufficient. – David Maze Jun 18 '20 at 11:07
  • Thank you @DavidMaze for your time and response. If I expose it as Nodeport, will I be able to browse/curl the nginx application and see the nginx default Page. Because I tried it didn't work and read couple of blogs and says that you need to expose as load balancer service. Please correct if I am wrong. – Rahul Jun 18 '20 at 11:14
  • LoadBalancer service you can only use for cloud services like aws,azure etc .For local you can use NodePort . – Chintamani Jun 18 '20 at 11:17

0 Answers0