metallb: selfLink is missing
I am getting the following error:
E1214 23:18:43.475271 1 event.go:296] Could not construct reference to: '&v1.Service{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"ingress-nginx-controller-ipv6", GenerateName:"", Namespace:"default", SelfLink:"", UID:"7ccdee5d-3caf-4e36-8d54-75482263c85d", ResourceVersion:"119477090", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:63743503894, loc:(*time.Location)(0x1a6e740)}}, 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\":\"ingress-nginx-controller-ipv6\",\"namespace\":\"default\"},\"spec\":{\"externalIPs\":[\"2001:44b8:4112:8a03::13\"],\"ipFamilies\":[\"IPv6\"],\"ipFamilyPolicy\":\"SingleStack\",\"ports\":[{\"name\":\"http\",\"port\":80,\"protocol\":\"TCP\",\"targetPort\":\"http\"},{\"name\":\"https\",\"port\":443,\"protocol\":\"TCP\",\"targetPort\":\"https\"}],\"selector\":{\"app.kubernetes.io/component\":\"controller\",\"app.kubernetes.io/instance\":\"ingress-nginx\",\"app.kubernetes.io/name\":\"ingress-nginx\"},\"type\":\"ClusterIP\"}}\n"}, OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initializers)(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry{v1.ManagedFieldsEntry{Manager:"kubectl-client-side-apply", Operation:"Update", APIVersion:"v1", Time:(*v1.Time)(0xc0003756c0), Fields:(*v1.Fields)(nil)}, v1.ManagedFieldsEntry{Manager:"kubectl-edit", Operation:"Update", APIVersion:"v1", Time:(*v1.Time)(0xc0003756e0), Fields:(*v1.Fields)(nil)}}}, Spec:v1.ServiceSpec{Ports:[]v1.ServicePort{v1.ServicePort{Name:"http", Protocol:"TCP", Port:80, TargetPort:intstr.IntOrString{Type:1, IntVal:0, StrVal:"http"}, NodePort:31069}, v1.ServicePort{Name:"https", Protocol:"TCP", Port:443, TargetPort:intstr.IntOrString{Type:1, IntVal:0, StrVal:"https"}, NodePort:32066}}, Selector:map[string]string{"app.kubernetes.io/component":"controller", "app.kubernetes.io/instance":"ingress-nginx", "app.kubernetes.io/name":"ingress-nginx"}, ClusterIP:"fc01::5e88", Type:"LoadBalancer", ExternalIPs:[]string{"2001:44b8:4112:8a03::13"}, 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(nil)}}}' due to: 'selfLink was empty, can't make reference'. Will not report event: 'Normal' 'IPAllocated' 'Assigned IP "2001:44b8:4112:8a03::"'
I believe the key error here is “selfLink was empty, can’t make reference”.
But selfLink is deprecated in Kubernetes 0.20.0.
Relevant references:
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 11
- Comments: 18 (2 by maintainers)
Any chance we can get a release including this fix soon-ish?
As far as I understand, the problem is related to the Kubernetes libraries that are used in the MetalLB sources, which are very old. The selfLink features is deprecated and will be removed with Kubernetes 1.21. The --feature-gates=RemoveSelfLink=false trick will only work for 1.20.x - Only real solution is compiling MetalLB with newer Kubernetes Go libraries.
See waiting PR https://github.com/metallb/metallb/pull/723
You got it @stefanbethke. Thanks for your patience!
My understanding is without the workaround -
--feature-gates=RemoveSelfLink=false
- which will stop working in 0.21.0, then metaLB is unusable.