gimlet-io / onechart

A generic Helm chart for your application deployments
https://gimlet.io/docs/reference/onechart-reference
Apache License 2.0
283 stars 48 forks source link

Allow to set the ingress tls secretName #117

Closed anbraten closed 8 months ago

anbraten commented 9 months ago

For wildcard deployments we already have a tls-secret and would like to reuse it for multiple deployments. Therefore it would be helpful to have an option like ingress.tls.secretName.

PS: pretty cool approach. I had a short test on creating a cli tool to deploy a local project by building the image, automatically pushing it to some configured registry and deploying it using onechart.

anbraten commented 9 months ago

Okay after reading again this seems to be already working, I was just missing the - 🤦🏾 .

This seems to work:

ingress:
  tlsEnabled: true
  host: example.com
  tls:
    - secretName: tls-my-wildcard
anbraten commented 9 months ago

Okay, that still doesn't seems to work. Should I try to add sth like ingress.tls.secretName to overwrite or rather ingressSpec for a default merge similar to podSpec seems to work?

laszlocph commented 9 months ago

What about?

#values.yaml
ingress:
  host: xxx
  tlsEnabled: true
  secretName: tls-internal
anbraten commented 9 months ago

That would work for me. Should I open a PR?

laszlocph commented 9 months ago

I mean it is working today like this.

anbraten commented 9 months ago

Using the values you suggested and helm template my-release onechart/onechart -f onechart.yaml I get:

---
# Source: onechart/templates/ingress.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: my-release
  namespace: default
  labels:
    helm.sh/chart: onechart-0.64.0
    app.kubernetes.io/name: onechart
    app.kubernetes.io/instance: my-release
    app.kubernetes.io/managed-by: Helm
spec:
  tls:
    - hosts:
        - "xxx"
      secretName: tls-my-release
  rules:
    - host: "xxx"
      http:
        paths:
          - path: "/"
            pathType: "Prefix"
            backend:
              service:
                name: my-release
                port:
                  number: 80
laszlocph commented 8 months ago

You are right. We have this feature in a private fork of a client. I was under the impression this is available. We are adding it to onechart now.