helmify icon indicating copy to clipboard operation
helmify copied to clipboard

Secret value not transferred to output values.yaml

Open Vaintti opened this issue 2 years ago • 9 comments

I have a secret defined in a kubernetes yaml file but the value doesn't get transferred to generated values.yaml file

Input

apiVersion: v1
kind: Secret
metadata:
  name: db-password
type: Opaque
data:
  password: c3VwZXJzZWNyZXRwYXNzd29yZAo=

Output

dbPassword:
  password: ""
kubernetesClusterDomain: cluster.local

Expected output

dbPassword:
  password: "supersecretpassword"
kubernetesClusterDomain: cluster.local

Vaintti avatar Apr 05 '23 10:04 Vaintti

Hi @Vaintti, thank you for the question. This was done on purpose. In most cases, generated chart will be stored in git. In this case, it is not a good idea to have secrets in values.yaml. So secretes are omitted from values.yaml and marked as required in a template to force chart user to provide it as flags in helm install.

arttor avatar Apr 05 '23 17:04 arttor

Just thinking if this should be made possible with a flag. --use-unsafe-secrets or something to make it clear it's not the safest of practices

Vaintti avatar Apr 05 '23 23:04 Vaintti

I agree that it is inconvenient but it is true for all security measures. I suggest not implementing this option right now. But we can do so if we have more votes for this feature.

arttor avatar Apr 06 '23 11:04 arttor

I'm interested. My use case would be something like: Take a single kubernetes.yaml coming from the repository, concatenate it with a local secret.yaml, run helmify, and apply the resulting helmchart. It would be useful in airgaped scenarios

vmath3us avatar Aug 04 '23 12:08 vmath3us

+1

saper44rus avatar Nov 26 '23 02:11 saper44rus

In most cases, using a template is the correct approach. However, in some cases, I require an instance configuration that can be used for quick conversion and unified management. In such cases, I prefer the configuration to remain as close to the original as possible, so that I can use it quickly.

I suggest splitting it into different modes. This can help avoid similar issues from occurring.

maobuji avatar Dec 15 '23 06:12 maobuji