I deployed metallb operator and assigned a range that is available in my network. I then deployed mcirobot to test the service. It gets an external IP, but the service isn't reachable on it.
$ kubectl apply -n microbot -f https://raw.githubusercontent.com/charmed-kubernetes/metallb-operator/master/docs/example-microbot-lb.yaml
deployment.apps/microbot-lb created
service/microbot-lb created
$ kubectl get all -n microbot
NAME READY STATUS RESTARTS AGE
pod/microbot-lb-57db6678d5-cbrkj 1/1 Running 0 5s
pod/microbot-lb-57db6678d5-mxnt6 1/1 Running 0 5s
pod/microbot-lb-57db6678d5-xlcgj 1/1 Running 0 5s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/microbot-lb LoadBalancer 10.152.183.143 172.24.70.220 80:30217/TCP 5s
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/microbot-lb 3/3 3 3 5s
NAME DESIRED CURRENT READY AGE
replicaset.apps/microbot-lb-57db6678d5 3 3 3 5s
$ curl 172.24.70.220
curl: (7) Failed to connect to 172.24.70.220 port 80: No route to host
The logs in one of the metallb-speaker pods show an error:
$ kubectl get pods -n metallb-system
NAME READY STATUS RESTARTS AGE
metallb-controller-7fb4d6984b-6bqvn 1/1 Running 0 13m
metallb-controller-operator-0 1/1 Running 0 15m
metallb-speaker-72zlv 1/1 Running 0 14m
metallb-speaker-operator-0 1/1 Running 0 15m
metallb-speaker-rfvq9 1/1 Running 0 14m
metallb-speaker-wj54v 1/1 Running 0 14m
modeloperator-5f7c78db58-kzhz6 1/1 Running 0 19m
{"caller":"main.go:267","event":"startUpdate","msg":"start of service update","service":"microbot/microbot-lb","ts":"2021-03-17T15:58:38.497253916Z"}
{"caller":"main.go:343","event":"serviceAnnounced","ip":"172.24.70.220","msg":"service has IP, announcing","pool":"default","protocol":"layer2","service":"microbot/microbot-lb","ts":"2021-03-17T15:58:38.497451117Z"}
E0317 15:58:38.497547 1 event.go:296] Could not construct reference to: '&v1.Service{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"microbot-lb", GenerateName:"", Namespace:"microbot", SelfLink:"", UID:"0b81bb45-5e45-4e7f-88c6-9d9850c01ee1", ResourceVersion:"334080", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:63751593516, loc:(*time.Location)(0x1f50960)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"name\":\"microbot-lb\",\"namespace\":\"microbot\"},\"spec\":{\"ports\":[{\"name\":\"microbot-lb\",\"port\":80,\"protocol\":\"TCP\",\"targetPort\":80}],\"selector\":{\"app\":\"microbot-lb\"},\"type\":\"LoadBalancer\"}}\n"}, OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry{v1.ManagedFieldsEntry{Manager:"controller", Operation:"Update", APIVersion:"v1", Time:(*v1.Time)(0xc0004efae0), Fields:(*v1.Fields)(nil)}, v1.ManagedFieldsEntry{Manager:"kubectl-client-side-apply", Operation:"Update", APIVersion:"v1", Time:(*v1.Time)(0xc0004efb00), Fields:(*v1.Fields)(nil)}}}, Spec:v1.ServiceSpec{Ports:[]v1.ServicePort{v1.ServicePort{Name:"microbot-lb", Protocol:"TCP", Port:80, TargetPort:intstr.IntOrString{Type:0, IntVal:80, StrVal:""}, NodePort:30217}}, Selector:map[string]string{"app":"microbot-lb"}, ClusterIP:"10.152.183.143", Type:"LoadBalancer", ExternalIPs:[]string(nil), SessionAffinity:"None", LoadBalancerIP:"", LoadBalancerSourceRanges:[]string(nil), ExternalName:"", ExternalTrafficPolicy:"Cluster", HealthCheckNodePort:0, PublishNotReadyAddresses:false, SessionAffinityConfig:(*v1.SessionAffinityConfig)(nil)}, Status:v1.ServiceStatus{LoadBalancer:v1.LoadBalancerStatus{Ingress:[]v1.LoadBalancerIngress{v1.LoadBalancerIngress{IP:"172.24.70.220", Hostname:""}}}}}' due to: 'selfLink was empty, can't make reference'. Will not report event: 'Normal' 'nodeAssigned' 'announcing from node "juju-f20297-9-kvm-0"'
{"caller":"main.go:346","event":"endUpdate","msg":"end of service update","service":"microbot/microbot-lb","ts":"2021-03-17T15:58:38.497767368Z"}
{"caller":"main.go:267","event":"startUpdate","msg":"start of service update","service":"microbot/microbot-lb","ts":"2021-03-17T15:58:38.508612389Z"}
{"caller":"main.go:343","event":"serviceAnnounced","ip":"172.24.70.220","msg":"service has IP, announcing","pool":"default","protocol":"layer2","service":"microbot/microbot-lb","ts":"2021-03-17T15:58:38.508728795Z"}
E0317 15:58:38.508814 1 event.go:296] Could not construct reference to: '&v1.Service{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"microbot-lb", GenerateName:"", Namespace:"microbot", SelfLink:"", UID:"0b81bb45-5e45-4e7f-88c6-9d9850c01ee1", ResourceVersion:"334080", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:63751593516, loc:(*time.Location)(0x1f50960)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"name\":\"microbot-lb\",\"namespace\":\"microbot\"},\"spec\":{\"ports\":[{\"name\":\"microbot-lb\",\"port\":80,\"protocol\":\"TCP\",\"targetPort\":80}],\"selector\":{\"app\":\"microbot-lb\"},\"type\":\"LoadBalancer\"}}\n"}, OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry{v1.ManagedFieldsEntry{Manager:"controller", Operation:"Update", APIVersion:"v1", Time:(*v1.Time)(0xc0004efae0), Fields:(*v1.Fields)(nil)}, v1.ManagedFieldsEntry{Manager:"kubectl-client-side-apply", Operation:"Update", APIVersion:"v1", Time:(*v1.Time)(0xc0004efb00), Fields:(*v1.Fields)(nil)}}}, Spec:v1.ServiceSpec{Ports:[]v1.ServicePort{v1.ServicePort{Name:"microbot-lb", Protocol:"TCP", Port:80, TargetPort:intstr.IntOrString{Type:0, IntVal:80, StrVal:""}, NodePort:30217}}, Selector:map[string]string{"app":"microbot-lb"}, ClusterIP:"10.152.183.143", Type:"LoadBalancer", ExternalIPs:[]string(nil), SessionAffinity:"None", LoadBalancerIP:"", LoadBalancerSourceRanges:[]string(nil), ExternalName:"", ExternalTrafficPolicy:"Cluster", HealthCheckNodePort:0, PublishNotReadyAddresses:false, SessionAffinityConfig:(*v1.SessionAffinityConfig)(nil)}, Status:v1.ServiceStatus{LoadBalancer:v1.LoadBalancerStatus{Ingress:[]v1.LoadBalancerIngress{v1.LoadBalancerIngress{IP:"172.24.70.220", Hostname:""}}}}}' due to: 'selfLink was empty, can't make reference'. Will not report event: 'Normal' 'nodeAssigned' 'announcing from node "juju-f20297-9-kvm-0"'
{"caller":"main.go:346","event":"endUpdate","msg":"end of service update","service":"microbot/microbot-lb","ts":"2021-03-17T15:58:38.509050613Z"}
More info about the whole setup:
This is a charmed kubernetes 1.20 deployment, there are 3 worker nodes in virtual machines. The charm deployed without issue, status is green/idle.
Additionally, I've tested deploying the upstream metallb manifests, and I was able to reach the microbot service at its external ip.