Support services defined by External IPs #5562
Replies: 2 comments
-
just did some tests with |
Beta Was this translation helpful? Give feedback.
-
Here's my config for Config
The resulting nginx config
ResultsTraffic is being split between a real upstream (user agent returned in response) and the dummy upstream (
NIC LogsLogs show NIC proxying traffic to both the valid upstream and dummy upstream
|
Beta Was this translation helpful? Give feedback.
-
A popular use case is the ability to use NGINX Ingress Controller as a general purpose software based proxy, that runs on Kubernetes compute.
This has becomes popular with companies that have abandoned machines & virtual machines and have standardized on Kubernetes as their compute platform of choice. This is primarily driven by a desire for common operational practices, flexibility that comes with containers, and 'git ops' practices such as 'infrastructure as code.'
NIC supports externalName services today as upstream / backend targets.
ExternalName Services require the
resolver
directive and an external DNS server / source be defined.They are limited to one DNS entry.
The single DNS entry limitation is acceptable for customers that have the ability to manage their own internal DNS service. As a single DNS name can return an array of IP addresses back to NGINX which will simply populate the list if IP addresses as the upstream targets.
This is how
resolver
functions.One possible way to address a limitation like this is to add support for ExternalIPs services
This would give customers similar control as adding multiple servers to a single DNS record, but covers the case where the folks that need the flexibility do not have this level of control to DNS, but can be granted this level of control in Kubernetes.
I would say this is preferred.
When implementing this, it is recommended that at a minimum passive health checks also be implemented (this requires the ability to send a ping (aka ICMP) on the network outside the cluster to the target. More reliable would be an active healthcheck, which is available with N+. Either way, NGINX would eventually stop sending traffic to any single failed upstream on its own after multiple failed requests.
Health checks are available and are applied to each upstream that is resolved from the K8s API.
Alternative ideas:
Allow multiple ExternalNames services be defined
Without significant logic changes, this would result in a single upstream group be defined for each ExternalName Service. While this is not an absolute functional deficiency, it requires the use of splits.
A customer can do this today. While not ideal, it is possible. And each upstream group would contain one upstream service and the individual server entries resolved by
resolver
.Support a customer being able to define a list of DNS or IP names as upstreams (instead of services)
This is a pattern that while valid for NGINX does not follow Kubernetes patterns at all.
Due to that, we don't recommend this.
This is similar to not supporting snippets for upstreams. Arbitrary injection of a block of conf does not align with how upstreams are managed by system (ingress controller).
Beta Was this translation helpful? Give feedback.
All reactions