Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

tls and extraTls #1324

Open
cdenneen opened this issue Sep 15, 2023 · 2 comments
Open

tls and extraTls #1324

cdenneen opened this issue Sep 15, 2023 · 2 comments
Labels
backlog Issues/PRs that will be included in the project roadmap chart

Comments

@cdenneen
Copy link

When adding something like a common-name to a certificate

    ingress:
      enabled: true
      className: nginx
      annotations:
        cert-manager.io/cluster-issuer: letsencrypt
        cert-manager.io/common-name: "sealed-secrets.platform.example.com"
      tls: true
      hostname: sealed-secrets.kustomize-me.clusters.aws.platform.example.com
      extraHosts:
        - name: sealed-secrets.platform.example.com

The tls hosts in the template shouldn't be a single host from ingress.hostname but in fact a list of hosts (hostname AND common-name). Most helm templates for ingress include a range to allow for multiple host names to be provided to the dnsNames of the cert.

Using extraTls doesn't match this model because it creates a completely separate certificate.

Most helm ingress values provide list of hosts vs a single hostname so that's why it scales but in this template that isn't the case.

https://github.com/bitnami-labs/sealed-secrets/blob/main/helm/sealed-secrets/templates/ingress.yaml#L46

Most charts (except for bitnami) use this type of format to have multiple hostnames
https://github.com/dexidp/helm-charts/blob/master/charts/dex/templates/ingress.yaml#L33

However the values format should look something more like:

    ingress:
      enabled: true
      className: nginx
      annotations:
        cert-manager.io/cluster-issuer: letsencrypt
        cert-manager.io/common-name: "sealed-secrets.platform.example.com"
      hosts:
        - host: sealed-secrets.kustomize-me.clusters.aws.platform.example.com
          paths:
            - path: /
              pathType: ImplementationSpecific
        - host: sealed-secrets.platform.example.com
          paths:
            - path: /
              pathType: ImplementationSpecific
      tls:
        - hosts:
            - sealed-secrets.kustomize-me.clusters.aws.platform.example.com
            - sealed-secrets.platform.example.com
          secretName: sealed-secrets-tls
@cdenneen cdenneen added the triage Issues/PRs that need to be reviewed label Sep 15, 2023
@cdenneen
Copy link
Author

Work around for now was to create a Certificate myself and use the following values (removed tls: true and the annotations):

    ingress:
      enabled: true
      ingressClassName: nginx
      hostname: sealed-secrets.kustomize-me.clusters.aws.platform.example.com
      extraHosts:
        - name: sealed-secrets.platform.example.com
      extraTls:
        - hosts:
            - sealed-secrets.platform.example.com
            - sealed-secrets.kustomize-me.clusters.aws.platform.example.com
          secretName: sealed-secrets-tls
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: sealed-secrets
  namespace: kube-system
spec:
  commonName: sealed-secrets.platform.example.com
  dnsNames:
    - sealed-secrets.platform.example.com
    - sealed-secrets.kustomize-me.clusters.aws.platform.example.com
  secretName: sealed-secrets-tls
  privateKey:
    rotationPolicy: Always
  issuerRef:
    kind: ClusterIssuer
    name: letsencrypt

@cdenneen
Copy link
Author

Actually to avoid having to setup a Certificate resource directly I was able to use cert-manager annotation just had to keep tls: false and only use extraTls:

    ingress:
      enabled: true
      ingressClassName: nginx
      annotations:
        cert-manager.io/cluster-issuer: letsencrypt
        cert-manager.io/common-name: sealed-secrets.platform.example.com
      hostname: sealed-secrets.kustomize-me.clusters.aws.platform.example.com
      extraHosts:
        - name: sealed-secrets.platform.example.com
      extraTls:
        - hosts:
            - sealed-secrets.platform.example.com
            - sealed-secrets.kustomize-me.clusters.aws.platform.example.com
          secretName: sealed-secrets-tls-secret

@alvneiayu alvneiayu added backlog Issues/PRs that will be included in the project roadmap chart and removed triage Issues/PRs that need to be reviewed labels Oct 5, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
backlog Issues/PRs that will be included in the project roadmap chart
Projects
None yet
Development

No branches or pull requests

2 participants