1
0
Fork 0

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:
Ed Robinson 2016-05-18 16:46:19 +01:00
parent 70494117d1
commit 5923d22379
No known key found for this signature in database
GPG key ID: EC501FCA6421CCF0
2 changed files with 172 additions and 18 deletions

View file

@ -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)