Introduce ingress.path and ingress.tls.useDefaultSecret config options for Ingress Auto Deploy
This MR introduces 2 new config options for the Ingress template.
ingress.path
This option allows to specify path for ingress to listen at ("location" in nginx terms). If not configured, it falls back to the previously hardcoded value of /
.
What is it useful for? In our case we need to distinguish different apis by their name (path) and they all listen on the same url. For example:
- url: api.myapp.com
- api kind 1: api.myapp.com/kind1/v1
- api kind 2: api.myapp.com/kind2/v1
By using this option with value /kind1/v1
we can achieve ingress spec like this:
spec:
rules:
- host: api.myapp.com
http:
paths:
- backend:
serviceName: kind1-api-http
servicePort: 80
path: /kind1/v1/
ingress.tls.useDefaultSecret
This config option allows to configure the nginx ingress to use the default certificate (if it is configured).
By setting this option to true
it removes the secretName
stanza from ingress tls
definition, forcing ingress to use default cert.
It is again useful in case you either have a wildcard cert or you have multiple ingresses listening on the same url with different paths in different namespaces.
In our case, we provide a default cert for api.myapp.com
and with this option we don't need to configure k8s secret for each of the ingresses.
Thanks :)