Do not create endpoints if service of type ExternalName (#114814)

This commit is contained in:
Viacheslav Panasovets
2023-01-18 12:12:34 +01:00
committed by GitHub
parent 46f3821bf4
commit 6adf60fdf4
5 changed files with 268 additions and 1 deletions

View File

@@ -378,6 +378,12 @@ func (e *Controller) syncService(ctx context.Context, key string) error {
return nil
}
if service.Spec.Type == v1.ServiceTypeExternalName {
// services with Type ExternalName receive no endpoints from this controller;
// Ref: https://issues.k8s.io/105986
return nil
}
if service.Spec.Selector == nil {
// services without a selector receive no endpoints from this controller;
// these services will receive the endpoints that are created out-of-band via the REST API.