-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubernetes Ingress pathType
should be configurable without an additonal quarkus.kubernetes.ingress.rules
rule
#43783
Comments
/cc @geoand (kubernetes), @iocanel (kubernetes), @radcortez (config) |
quarkus.kubernetes.ingress.rules
RolepathType
should be configurable without an additonal quarkus.kubernetes.ingress.rules
Rule
pathType
should be configurable without an additonal quarkus.kubernetes.ingress.rules
RulepathType
should be configurable without an additonal quarkus.kubernetes.ingress.rules
rule
We need the dummy rule as shown above in the actual behavior section, as updating the existing rule does not work when we set the additional rule with the same See the integrations test ( This example quarkus.kubernetes.ingress.expose=true
quarkus.kubernetes.ingress.host=prod.svc.url
quarkus.kubernetes.ingress.annotations."nginx.ingress.kubernetes.io/rewrite-target"=/api/$2
quarkus.kubernetes.ports.http.path=/something(/|$)(.*)
quarkus.kubernetes.ingress.rules.0.host=prod.svc.url
quarkus.kubernetes.ingress.rules.0.path=/something(/|$)(.*)
quarkus.kubernetes.ingress.rules.0.path-type=ImplementationSpecific generates the following ingress with a duplicate path: apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
app.kubernetes.io/version: 2.12.9
app.quarkus.io/quarkus-version: 3.15.1
app.quarkus.io/build-timestamp: 2024-10-09 - 12:58:17 +0000
nginx.ingress.kubernetes.io/rewrite-target: /api/$2
labels:
app.kubernetes.io/name: my-api
app.kubernetes.io/version: 2.12.9
app.kubernetes.io/managed-by: quarkus
name: my-api
namespace: my-namespace
spec:
rules:
- host: app.example.com
http:
paths:
- backend:
service:
name: my-api
port:
name: http
path: /something(/|$)(.*)
pathType: ImplementationSpecific
- backend:
service:
name: my-api
port:
name: http
path: /something(/|$)(.*)
pathType: Prefix
tls:
- hosts:
- app.example.com
secretName: my-certificate |
I'll leave this to @iocanel |
Describe the bug
@Sgitario @geoand @iocanel as a continuation of #26747 and with the Kubernetes NGINX Ingress versions >=
1.8.0
warningnetworking.k8s.io.ingress Creation Warning -> 299 - path /something(/|$)(.*) cannot be used with pathType Prefix
when a rewrite is used, it is important that thepathType
of the default generated ingress is configurable.# One of Prefix (default), Exact or ImplementationSpecific quarkus.kubernetes.ports.http.path-type
https://github.com/kubernetes/ingress-nginx/releases/tag/controller-v1.8.0
https://kubernetes.github.io/ingress-nginx/faq/#validation-of-path
kubernetes/ingress-nginx#11819
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/#strict-validate-path-type
I know the following example rewrite does not make sense to you as one could use
quarkus.http.root-path
,quarkus.http.non-application-root-path
, andquarkus.rest.path
, but I have a valid use case for a legacy application where I need this rewrite.The warning will not appear by correctly setting the
pathType
toImplementationSpecific
using Kubernetes NGINX Ingress versions >=1.8.0
.Expected behavior
The developer should be able to configure the default generated ingress
pathType
using the new configuration propertyquarkus.kubernetes.ports.http.path-type
.Actual behavior
Currently, it is not possible to configure the generated
pathType
for the default generated ingress.It is only possible using an additional rule where one would need to create a dummy path for the default generated ingress rule, and then we need to duplicate configuration option values.
How to Reproduce?
No response
Output of
uname -a
orver
No response
Output of
java -version
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.4+8.1 (build 21.0.4+8-LTS-jvmci-23.1-b41)
Quarkus version or git rev
3.15.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)8.10.2
Additional information
No response
The text was updated successfully, but these errors were encountered: