I suggest that like the z2jh helm chat does, this Helm chart generates such private key unless explicitly passed and saves it into a k8s Secret and relies on the lookup function to catch it during helm template rendering. In other words, that we seed the SSH key for users that doesn't specify it, and we make sure to reuse a previously seeded SSH key.
http://masterminds.github.io/sprig/crypto.html describes how
sprig
, a library exposing functions thathelm
can use, includesgenPrivateKey
that allows us to generate a private key.I suggest that like the z2jh helm chat does, this Helm chart generates such private key unless explicitly passed and saves it into a k8s Secret and relies on the
lookup
function to catch it during helm template rendering. In other words, that we seed the SSH key for users that doesn't specify it, and we make sure to reuse a previously seeded SSH key.For some reference examples on doing this, see: