The referenced k8s service(s) must be in namespace
By design k8s ingress is only designed to ballance services from within the namespace of the ingress. This is disscuessed a little in https://github.com/kubernetes/kubernetes/issues/17088. For now traefik should only reference the services in the current namespace. For me this was a confusing change of behaviour from the reference implimentations, as I have services with the same name in each namespace.
This commit is contained in:
parent
70494117d1
commit
5923d22379
2 changed files with 172 additions and 18 deletions
|
@ -186,7 +186,7 @@ func (provider *Kubernetes) loadIngresses(k8sClient k8s.Client) (*types.Configur
|
|||
}
|
||||
}
|
||||
services, err := k8sClient.GetServices(func(service k8s.Service) bool {
|
||||
return service.Name == pa.Backend.ServiceName
|
||||
return service.ObjectMeta.Namespace == i.ObjectMeta.Namespace && service.Name == pa.Backend.ServiceName
|
||||
})
|
||||
if err != nil {
|
||||
log.Errorf("Error retrieving services: %v", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue