Add configuration to disable external name service feature (#7314)
Signed-off-by: Ricardo Pchevuzinske Katz <ricardo.katz@gmail.com>
This commit is contained in:
parent
16072ac690
commit
bc220f7366
5 changed files with 136 additions and 23 deletions
|
|
@ -85,6 +85,8 @@ type Configuration struct {
|
|||
|
||||
ListenPorts *ngx_config.ListenPorts
|
||||
|
||||
DisableServiceExternalName bool
|
||||
|
||||
EnableSSLPassthrough bool
|
||||
|
||||
EnableProfiling bool
|
||||
|
|
@ -968,6 +970,10 @@ func (n *NGINXController) serviceEndpoints(svcKey, backendPort string) ([]ingres
|
|||
|
||||
// Ingress with an ExternalName Service and no port defined for that Service
|
||||
if svc.Spec.Type == apiv1.ServiceTypeExternalName {
|
||||
if n.cfg.DisableServiceExternalName {
|
||||
klog.Warningf("Service %q of type ExternalName not allowed due to Ingress configuration.", svcKey)
|
||||
return upstreams, nil
|
||||
}
|
||||
servicePort := externalNamePorts(backendPort, svc)
|
||||
endps := getEndpoints(svc, servicePort, apiv1.ProtocolTCP, n.store.GetServiceEndpoints)
|
||||
if len(endps) == 0 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue