-
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
Allow configuring Ingress rules #28813
Conversation
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
@iocanel can you review this? Thanks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@Sgitario I tried to backport this one to 2.13 but I get:
so my guess is that the Dekorate version we have in 2.13 doesn't support this. I put the backport label back for now, please remove it if this is confirmed. |
Indeed, this is only for 2.14 as it depends on the latest Dekorate version. |
These changes also ensures that not duplicated ingress rules are generated.
Adding Ingress rules
To customize the default
host
andpath
properties of the generated Ingress resources, you need to apply the following configuration:This would generate the following Ingress resource:
Additionally, you can also add new Ingress rules by adding the following configuration:
This would generate the following Ingress resource:
Fix #28812 Fix #26747