In would be great to add support for prefix and suffix server names (i.e. ".top.domain" and "sub.domain.").
It makes it possible to reuse the same ingress definition in several environments.
k8s does not allow to specify wildcard server names, but it may be added as annotation "ingress.kubernetes.io/prefix-wildcard".
Please let me know if there is a better way to support it.
I can make PR for this feature.
@electroma you can use the same FQDN in mutiple ingress rules. The only restriction is that you cannot use the path multiple times. If there is path conflicts the first created ingress rule wins.
@electroma please reopen if you still have issues
@aledbf thank you for your reply.
Let me give some examples.
Example 1:
I've got several environments running same set of components.
Each environment has a public domain.
I have ingress object for each public resource.
Using FQDN approach I need to copy/template ingress object on every environment (component.[env.parent.domain]).
Example 2:
My k8s ingress controller is exposed on several domains, for example public and internal.
In this case I need to create separate ingress object for each domain.
Now I'm using helm charts to create several ingress objects, but it's just a duplication.
In this setup each chart should know parent domain(s).
My proposal is to add support for basic prefix names instead of FQDN and let ingress controller to form FQDN of it.
It can help to reduce number of duplicate ingress objects in scenario described above.
@aledbf I can't reopen this issue. Let me know if I need to create another one.
My proposal is to add support for basic prefix names instead of FQDN and let ingress controller to form FQDN of it.
Right but this also increases the complexity of the generation of the template to render.
My proposal is to add support for basic prefix names instead of FQDN and let ingress controller to form FQDN of it.
Please post some examples
This is an example of prefix Ingress syntax:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: auth-service
annotations:
ingress.kubernetes.io/prefix-wildcard-subdomain: true
spec:
rules:
- host: auth
http:
paths:
- backend:
serviceName: auth-svc
servicePort: 80
path: /
During conversion it will be converted to the construct server_name auth.* in NGINX configuration.
Prefix server name will make the service available by any subdomain-name starting with "auth.".
I would like this for similar effect, but slightly different reasons: we're managing a couple of clusters for the dev teams here and it would be nice if they didn't need to know the ingress domain for the cluster they are targetting but just say "I want this name/subdomain" and let the IC take care of it.
My though on how to achieve it was an entry in the ConfigMap for the IC that says "my default domain is X, suffix it to anything not ending in a valid tld" but that's probably quite complex in hindsight.
Closing. This is out of the scope and soon we will have a LoadBalancerClaim concept https://docs.google.com/document/d/1Kj9OcTQdERZgNkZhdDxnQeT-TI4DLqqg62lShnboT6s/edit
Most helpful comment
This is an example of prefix Ingress syntax:
During conversion it will be converted to the construct
server_name auth.*in NGINX configuration.Prefix server name will make the service available by any subdomain-name starting with "auth.".