k8s icon indicating copy to clipboard operation
k8s copied to clipboard

[Kratos] - allow for custom yaml configmap name

Open Davincible opened this issue 2 years ago • 3 comments

Preflight checklist

Describe your problem

Currently, you can only config Kratos through either inline yaml in values.yaml, or specify every option through the env variables. Since the config contains info I don't want in VCS, I'm trying to avoid the former, but the latter becomes tedious when you want to specify a lot of custom values.

Describe your ideal solution

It would be much nicer if just like with the secret, you could provide a custom configmap name that will be used as configuration, so you can in yaml define the whole config, and avoid it going into VCS.

Workarounds or alternatives

Envs

Version

latest

Additional Context

No response

Davincible avatar Aug 07 '22 18:08 Davincible

Just found out that as a work around I can add an extra -c file.yaml and volume mount

Davincible avatar Aug 07 '22 19:08 Davincible

Hi there! If you are concerned about leaking sensitive data within the values/VCS, I would recommend overwriting those values with envs that are read from secrets. this should be more secure then providing a custom cm 😉

Demonsthere avatar Aug 10 '22 09:08 Demonsthere

Yes but you don't want to write out 20 ENVs. I managed to solve it like this, but the stateful set is missing the extraArgs option

deployment:
  extraVolumes:
    - name: config-volume
      configMap:
        name: kratos-config-extra
  extraVolumeMounts:
    - name: config-volume
      mountPath: /etc/kratos/
  extraArgs:
    - -c
    - /etc/kratos/config.yaml

statefulset:
  extraVolumes:
    - name: config-volume
      configMap:
        name: kratos-config-extra
  extraVolumeMounts:
    - name: config-volume
      mountPath: /etc/kratos/
  extraArgs:
    - -c
    - /etc/kratos/config.yaml

Davincible avatar Aug 11 '22 22:08 Davincible