Open leandrorosa opened 9 months ago
Hi @leandrorosa, I think this is because of the wildcard hostname in the Mapping. "If the Host defines a mappingSelector and the Mapping also defines a hostname, both must match. Mapping with a hostname of "*" will associate with any Host that has no mappingSelector." A wildcard is probably not considered a match.
HI @cindymullins-dw, We started to have a similar issue after upgrading from 3.1.0 to 3.7.2
We have one host:
apiVersion: getambassador.io/v3alpha1
kind: Host
metadata:
name: wildcard
spec:
ambassador_id: ["ambassador"]
hostname: '*'
acmeProvider:
authority: none
requestPolicy:
insecure:
action: Route
mappingSelector:
matchLabels:
foo: bar
Adding here 2 example of mappings, 1 of them with host_redirect: true
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: jobs-redirect
labels:
foo: bar
spec:
ambassador_id: ["ambassador"]
host_redirect: true
precedence: 200
prefix: /jobs
prefix_redirect: /careers
service: XYZ.com
timeout_ms: 60000
and
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: no-host-redirect
labels:
foo: bar
spec:
ambassador_id: ["ambassador"]
precedence: 200
prefix: /test
prefix_redirect: /testing
service: XYZ.com
timeout_ms: 60000
Only the one with the host_redirect isn't working ( we don't see it in the envoy/envoy.json)
After we removed the mappingSelector
from the host resource and added hostname: *
in the mapping it started to work.
Another solution was to add DISABLE_STRICT_LABEL_SELECTORS: "true"
environment variable.
Is there any issue with host_redirect mapping?
Versions:
Not stale, we having the same issue
Having the same issue here in 3.9.
Describe the bug Redirects are not being picked by emissary when it is associated with a Host by mappingSelector. If the mappingSelector is removed from the Host it works.
To Reproduce Create two hosts like this:
And then create a redirect like this:
The redirect will not work. If the mappingSelector is removed from the hosts it works.
Expected behavior Redirects being applied with the mappingSelector.
Versions (please complete the following information):