puppetlabs / puppetserver-helm-chart

The Helm Chart for Puppet Server
Apache License 2.0
47 stars 55 forks source link

Mounts puppetserver.extraSecrets into pods #221

Open cpiment opened 3 months ago

cpiment commented 3 months ago

Solves #166 and #192

Now puppetserver.extraSecrets must be a list of secret volumeMounts specifications like this:

extraSecrets:
  - name: myBigSecret
    mountPath: /custom/path/secret
    readOnly: true
  - name: myOtherBigSecret
    mountPath: /custom/other/key
    subPath: key
  - name: myOtherBigSecret
    mountPath: /custom/other/cert
    subPath: cert

That configuration creates two volumes in each pod: myBigSecret-volume and myOtherBigSecret-volume and three volumeMounts using the configuration specified in each extraSecrets items. The secrets referenced in name must exist in the namespace.

In #192 we discussed about a simpler implementation, but doing it like that supposed that we could not use extra configuration for the volumeMounts (e.g. subPath).

I open this as a draft PR because when I generate the manifests the new volumes an volumeMounts generate an extra blank line which I'm not able to get rid of. Could some of you please test it and help me with that blank lline?

Thanks in advance for your help

cpiment commented 3 months ago

@Xtigyro @ldaneliukas have you had the chance to have a look to this PR?

Thanks in advance!

Xtigyro commented 3 months ago

@cpiment I hadn't because it's a Draft PR. Now I did and it's looking good!

cpiment commented 3 months ago

Hi @Xtigyro

I have opened this as a draft PR because when I generate the manifests the new volumes and volumeMounts generate an extra blank line in the YAML which I'm not able to get rid of. Could you please test it and help me with that blank lline? It has to be something with the carriage returns when including the template, but I cannot find what's wrong.

Xtigyro commented 2 months ago

Hi @Xtigyro

I have opened this as a draft PR because when I generate the manifests the new volumes and volumeMounts generate an extra blank line in the YAML which I'm not able to get rid of. Could you please test it and help me with that blank lline? It has to be something with the carriage returns when including the template, but I cannot find what's wrong.

I might have some time to have a look towards the end of the week. @ldaneliukas @davidphay If any of you have some time, in the meantime, and help @cpiment - will be appreciated.

cpiment commented 2 months ago

Hi team,

Have you had time to check this fix? Do you have any idea how I can get rid of the blank lines every time I call the templates which insert the secrets and secretmounts?

Thanks in advance for your help

ke5C2Fin commented 1 month ago

Maybe some of the {{- end }} need to be {{- end -}}?