Skip to content
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

Tenant Helm Chart: Bucket DNS support incomplete #1796

Closed
stephan2012 opened this issue Oct 3, 2023 · 9 comments · Fixed by #1930
Closed

Tenant Helm Chart: Bucket DNS support incomplete #1796

stephan2012 opened this issue Oct 3, 2023 · 9 comments · Fixed by #1930

Comments

@stephan2012
Copy link

stephan2012 commented Oct 3, 2023

Is your feature request related to a problem? Please describe.
The Tenant Helm chart supports enabling the bucketDNS feature but only provides the Ingress configuration for the canonical domain. Kubernetes Ingresses support wildcards in hostnames nowadays, so a wildcard endpoint should be configured besides the canonical one.

Describe the solution you'd like
Add the wildcard hostname as the second path in the API Ingress.

Describe alternatives you've considered
There are no alternatives since the current implementation is semantically incomplete.

Additional context
Combined without automatic DNS configuration (e.g., external-dns), the Helm chart heads towards a plug-and-play solution.

Kindly let me know if you're interested in a PR.

@jiuker
Copy link
Contributor

jiuker commented Oct 7, 2023

helm install minio --set ingress.api.host=*.minio.local should be fine to you. @stephan2012 Or you want it set by default?

@stephan2012
Copy link
Author

Using just the wildcard expression may work depending on the Ingress Controller implementation. However, the Ingress specs explicitly state that *.foo.com does not match foo.com.

@stephan2012
Copy link
Author

By the way, it makes sense to automatically enable a wildcard host if bucket DNS is enabled.

@jiuker
Copy link
Contributor

jiuker commented Oct 9, 2023

By the way, it makes sense to automatically enable a wildcard host if bucket DNS is enabled.

I didn't get your point. Ingress config with hosts that is users DNS. How to do that with helm charts automatically? @stephan2012

@stephan2012
Copy link
Author

@jiuker
Copy link
Contributor

jiuker commented Oct 9, 2023

@stephan2012 I can see it will config with that "external-dns.alpha.kubernetes.io/hostname=nginx.example.org. which need a hostname anyway. So what did I missed?

@stephan2012
Copy link
Author

For Ingresses, external-dns do not require an annotation.

I can see it will config with that "external-dns.alpha.kubernetes.io/hostname=nginx.example.org. which need a hostname anyway. So what did I missed?

There are two different topics here: Usually, a service like external-dns or an administrator needs to create DNS records so that external systems know where to route traffic. While this usually is a requirement, it is not the scope of this issue.

This issue addresses the other part: Configuring the Ingress Controller. To fully support Bucket DNS besides paths, we need two different host records in the Ingress: One is the canonical service name (e.g., minio.my.domain), the other is a wildcard name (*.minio.my.domain). As referenced above, the Kubernetes Ingress specs explicitly state that the wildcard hostname does not match the canonical hostname, so we must list both in the Ingress.

alistarle added a commit to alistarle/operator that referenced this issue Jan 4, 2024
Create an extra ingress rule for wildcard api host if dns
feature is enabled. Need to configure the TLS block accordingly
in values.yaml

Fixes minio#1796
@alistarle
Copy link
Contributor

@stephan2012 I agree with the issue, I achieve to mitigate it using the extraResources features, but here is the PR who seems to fix the issue with a more elegant way.

Here is my workaroud, with an example of nginx ingress controller:

    extraResources:
    - |
      apiVersion: networking.k8s.io/v1
      kind: Ingress
      metadata:
        annotations:
          kubernetes.io/tls-acme: "true"
        name: myminio-wildcard
        namespace: minio
      spec:
        ingressClassName: nginx
        rules:
        - host: "*.myminio.mydomain.com"
          http:
            paths:
            - backend:
                service:
                  name: minio
                  port:
                    name: http-minio
              path: /
              pathType: Prefix
        tls:
        - hosts:
          - "*.myminio.mydomain.com"
          secretName: myminio-wildcard-tls

harshavardhana pushed a commit that referenced this issue Jan 5, 2024
Create an extra ingress rule for wildcard api host if dns
feature is enabled. Need to configure the TLS block accordingly
in values.yaml

Fixes #1796
@stephan2012
Copy link
Author

Thank you, @alistarle! 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants