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 path should be configurable #26747
Comments
Sounds reasonable, WDYT @iocanel ? |
Hmmm, maybe it is not as easy as I thought.
Then for example WDYT @geoand ? |
Interesting point |
Maybe the best solution would be to let the user set the HTTP ingress path with a new optional ingress property My use case is the following. Without such property the generated Kubernetes YAML/JSON need to be post-processed (for example with sed) to replace K8s ingress path defintion: |
Let's see what @iocanel thinks |
You can already set the ingress host property: Line 22 in f4238ad
This change was added in 788b5be. Let me know if this works for you and if we can close the issue now. |
Ahh cool, thanks! So the issue regarding secured ingress was fixed in Quarkus The PR/commit you mentioned fixes another workaround I made with a post-process step using |
Oh I see. Yes, I think we should let users configure the rules HTTP paths of the Ingress resources. I think this would need to be addressed on the Dekorate side first though. Wdyt @iocanel ? |
Yes, the only workaround is to provide a custom Ingress resource in |
Quarkus main has been updated using the latest version of Dekorate which includes dekorateio/dekorate#1083. So, I will be working on enabling this configuration in Quarkus asap. |
These changes also ensures that not duplicated ingress rules are generated. #### Adding Ingress rules To customize the default `host` and `path` properties of the generated Ingress resources, you need to apply the following configuration: ``` quarkus.kubernetes.ingress.expose=true # To change the Ingress host. By default, it's empty. quarkus.kubernetes.ingress.host=prod.svc.url # To change the Ingress path of the generated Ingress rule. By default, it's "/". quarkus.kubernetes.ports.http.path=/prod ``` This would generate the following Ingress resource: ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: labels: app.kubernetes.io/name: kubernetes-with-ingress app.kubernetes.io/version: 0.1-SNAPSHOT name: kubernetes-with-ingress spec: rules: - host: prod.svc.url http: paths: - backend: service: name: kubernetes-with-ingress port: name: http path: /prod pathType: Prefix ``` Additionally, you can also add new Ingress rules by adding the following configuration: ``` # Example to add a new rule quarkus.kubernetes.ingress.rules.1.host=dev.svc.url quarkus.kubernetes.ingress.rules.1.path=/dev quarkus.kubernetes.ingress.rules.1.path-type=ImplementationSpecific # by default, path type is Prefix # Exmple to add a new rule that use another service binding quarkus.kubernetes.ingress.rules.2.host=alt.svc.url quarkus.kubernetes.ingress.rules.2.path=/ea quarkus.kubernetes.ingress.rules.2.service-name=updated-service quarkus.kubernetes.ingress.rules.2.service-port-name=tcpurl ``` This would generate the following Ingress resource: ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: labels: app.kubernetes.io/name: kubernetes-with-ingress app.kubernetes.io/version: 0.1-SNAPSHOT name: kubernetes-with-ingress spec: rules: - host: prod.svc.url http: paths: - backend: service: name: kubernetes-with-ingress port: name: http path: /prod pathType: Prefix - host: dev.svc.url http: paths: - backend: service: name: kubernetes-with-ingress port: name: http path: /dev pathType: ImplementationSpecific - host: alt.svc.url http: paths: - backend: service: name: updated-service port: name: tcpurl path: /ea pathType: Prefix ``` Fix quarkusio#28812 Fix quarkusio#26747
Is this going to be merged in Quarkus |
That's the plan |
These changes also ensures that not duplicated ingress rules are generated. #### Adding Ingress rules To customize the default `host` and `path` properties of the generated Ingress resources, you need to apply the following configuration: ``` quarkus.kubernetes.ingress.expose=true # To change the Ingress host. By default, it's empty. quarkus.kubernetes.ingress.host=prod.svc.url # To change the Ingress path of the generated Ingress rule. By default, it's "/". quarkus.kubernetes.ports.http.path=/prod ``` This would generate the following Ingress resource: ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: labels: app.kubernetes.io/name: kubernetes-with-ingress app.kubernetes.io/version: 0.1-SNAPSHOT name: kubernetes-with-ingress spec: rules: - host: prod.svc.url http: paths: - backend: service: name: kubernetes-with-ingress port: name: http path: /prod pathType: Prefix ``` Additionally, you can also add new Ingress rules by adding the following configuration: ``` # Example to add a new rule quarkus.kubernetes.ingress.rules.1.host=dev.svc.url quarkus.kubernetes.ingress.rules.1.path=/dev quarkus.kubernetes.ingress.rules.1.path-type=ImplementationSpecific # by default, path type is Prefix # Exmple to add a new rule that use another service binding quarkus.kubernetes.ingress.rules.2.host=alt.svc.url quarkus.kubernetes.ingress.rules.2.path=/ea quarkus.kubernetes.ingress.rules.2.service-name=updated-service quarkus.kubernetes.ingress.rules.2.service-port-name=tcpurl ``` This would generate the following Ingress resource: ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: labels: app.kubernetes.io/name: kubernetes-with-ingress app.kubernetes.io/version: 0.1-SNAPSHOT name: kubernetes-with-ingress spec: rules: - host: prod.svc.url http: paths: - backend: service: name: kubernetes-with-ingress port: name: http path: /prod pathType: Prefix - host: dev.svc.url http: paths: - backend: service: name: kubernetes-with-ingress port: name: http path: /dev pathType: ImplementationSpecific - host: alt.svc.url http: paths: - backend: service: name: updated-service port: name: tcpurl path: /ea pathType: Prefix ``` Fix quarkusio#28812 Fix quarkusio#26747
These changes also ensures that not duplicated ingress rules are generated. #### Adding Ingress rules To customize the default `host` and `path` properties of the generated Ingress resources, you need to apply the following configuration: ``` quarkus.kubernetes.ingress.expose=true # To change the Ingress host. By default, it's empty. quarkus.kubernetes.ingress.host=prod.svc.url # To change the Ingress path of the generated Ingress rule. By default, it's "/". quarkus.kubernetes.ports.http.path=/prod ``` This would generate the following Ingress resource: ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: labels: app.kubernetes.io/name: kubernetes-with-ingress app.kubernetes.io/version: 0.1-SNAPSHOT name: kubernetes-with-ingress spec: rules: - host: prod.svc.url http: paths: - backend: service: name: kubernetes-with-ingress port: name: http path: /prod pathType: Prefix ``` Additionally, you can also add new Ingress rules by adding the following configuration: ``` # Example to add a new rule quarkus.kubernetes.ingress.rules.1.host=dev.svc.url quarkus.kubernetes.ingress.rules.1.path=/dev quarkus.kubernetes.ingress.rules.1.path-type=ImplementationSpecific # by default, path type is Prefix # Exmple to add a new rule that use another service binding quarkus.kubernetes.ingress.rules.2.host=alt.svc.url quarkus.kubernetes.ingress.rules.2.path=/ea quarkus.kubernetes.ingress.rules.2.service-name=updated-service quarkus.kubernetes.ingress.rules.2.service-port-name=tcpurl ``` This would generate the following Ingress resource: ```yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: labels: app.kubernetes.io/name: kubernetes-with-ingress app.kubernetes.io/version: 0.1-SNAPSHOT name: kubernetes-with-ingress spec: rules: - host: prod.svc.url http: paths: - backend: service: name: kubernetes-with-ingress port: name: http path: /prod pathType: Prefix - host: dev.svc.url http: paths: - backend: service: name: kubernetes-with-ingress port: name: http path: /dev pathType: ImplementationSpecific - host: alt.svc.url http: paths: - backend: service: name: updated-service port: name: tcpurl path: /ea pathType: Prefix ``` Fix quarkusio#28812 Fix quarkusio#26747 (cherry picked from commit 8cce3d5)
Describe the bug
Currently, the
quarkus-kubernetes
extension (2.10.2.Final) does not honor the value of Quarkus propertyquarkus.http.root-path
, so the Kubernetes ingress path is always the root/
.Expected behavior
The Kubernetes ingress path should equal property
quarkus.http.root-path
.application.properties
kubernetes.yml
Actual behavior
application.properties
kubernetes.yml
How to Reproduce?
https://code.quarkus.io/?j=17&e=kubernetes&e=resteasy-reactive&e=resteasy-reactive-jackson&extension-search=origin:platform%20resteasy
application.properties
Output of
uname -a
orver
Linux myhost 4.18.0-372.13.1.0.1.el8_6.x86_64 #1 SMP Fri Jul 1 15:06:54 PDT 2022 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)
GraalVM version (if different from Java)
OpenJDK 64-Bit Server VM GraalVM CE 22.1.0 (build 17.0.3+7-jvmci-22.1-b06, mixed mode, sharing)
Quarkus version or git rev
2.10.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 7.4.2
Additional information
No response
The text was updated successfully, but these errors were encountered: