Load balancer does not resolve when creating Service object

Mayank Arora 1 Reputation point
2022-03-30T12:32:32.42+00:00

Hi,

I'm creating an external load balancer for my cluster, using

apiVersion: v1
kind: Service
metadata:
name: create-account-service
spec:
type: LoadBalancer
selector:
app: cas
ports:

  • port: 5000
    targetPort: 5000
    name: create-account-service

The External-IP unfortunately does not resolve, im not sure why. I have 2 nodes in a nodes running in the cluster. Any suggestions? Using the default Kubenet configuration

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,869 questions
Azure Load Balancer
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
404 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,141 Reputation points Microsoft Employee
    2022-03-30T17:55:27.2+00:00

    Hello @Mayank Arora ,
    YAML syntax looks good. Can you check after deploying the above YAML file are you getting EXTERNAL_IP column getting populated with some IP ?
    If that column value is in pending state , please do the describe of service

    kubectl describe svc create-account-service

    In the events section you should be able to see the reason why the IP is not getting provisioned.
    Also in the above output check if the endpoints got updated with POD IPs
    In the YAML file , Just make sure the selector value is pointing to the pod selector.

    You can also try exposing the POD using imperative kubectl command like below:
    kubectl expose pod nginx --name=nginx-svc --type=LoadBalancer --port=5000 --target-port=5000 (This command is for exposing a sample nginx pod)

    Let us know if that helps out !

    0 comments No comments