Kubernetes Loadbalancer service External IP status is Pending

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version:1.19
Cloud being used: (put bare-metal if not on a public cloud) On Prem Server
Installation method: Installing Kubernetes with deployment tools ( Bootstrapping clusters with kubeadm)
Host OS: Red Hat Enterprise Linux Server 7.5 (Maipo)
CNI and version:
CRI and version: 1.18

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read. `apiVersion: v1
kind: Service
metadata:
name: client-service
labels:
app: dilclient
namespace: dilnamespace
spec:
type: LoadBalancer
ports:

  • nodePort: 31000
    port: 80
    targetPort: 8085
    selector:
    app: dilclient
    `
    [root@sesberi01809 kubernetes]# kubectl get svc
    NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
    kubernetes ClusterIP 10.96.0.1 443/TCP 18d
    my-service LoadBalancer 10.98.31.135 80:31000/TCP 8s
    [root@sesberi01809 kubernetes]#

but when i patched external IP of node as below
kubectl patch svc client -n dilnamespace -p ‘{“spec”: {“type”: “LoadBalancer”, “externalIPs”:[“128.87.242.22”]}}’

[root@sesberi01809 kubernetes]# kubectl get svc -n=dilnamespace
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
dilclient LoadBalancer 10.96.30.117 128.87.242.23 8085:31549/TCP 34h
dilsor LoadBalancer 10.100.115.183 128.87.242.22 7080:31937/TCP 31h
my-service NodePort 10.97.148.69 80:31111/TCP 71m
[root@sesberi01809 kubernetes]#

But problem is pods are running on different nodes which is not accessible with patched External IP. Only those pods accessible which are running on patched External IP of node.

Can anyone help me to allocate external IP of loadbalancer service and resolve the pending status of service without patching IP.

Thanks
Bala