Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function to load file contents into strings #553

Open
14 tasks
netthier opened this issue Jun 6, 2023 · 2 comments
Open
14 tasks

Add function to load file contents into strings #553

netthier opened this issue Jun 6, 2023 · 2 comments
Labels
good first issue Good for newcomers

Comments

@netthier
Copy link
Contributor

netthier commented Jun 6, 2023

Command

  • check-image-updates
  • delete
  • deploy
  • diff
  • helm-pull
  • helm-update
  • list-images
  • list-targets
  • poke-images
  • prune
  • render
  • seal
  • validate
  • version

Who are you?

DevOps Engineer

What do you want to do?

I want to load the contents of a file into a string without running it through jinja templating.
So I basically need an equivalent of load_template() that does not template.

Why do you need that?

I have an application that takes a large non-YAML config file (I put it into a ConfigMap and mount it as a volume).
I want users to be able to load that file from disk instead of specifying it as an inline YAML string.

@epcim
Copy link
Contributor

epcim commented Jun 7, 2023

Well to your req. I do understand your need, is valid. Load some file and dont render it (as you want to avoid escape sequences for {{ etc..

Sort of off-topic for discussion, but would not be more convenient to have a dedicated "config" sub-comand or dedicated config step on deployment.yml to deliver configuration, restart pods etc.. sth like https://github.com/kiwigrid/k8s-sidecar does. As from experience one day:

  • ConfigMap will be too big
  • Source is not file but Git repo, ...
  • You will only need to apply config to API of service, but want to avoid touch/restart pods
  • You need to run some API calls after the config is updated
  • You need to pre-process configs by some tool etc..

@codablock codablock added the good first issue Good for newcomers label Jun 7, 2023
@netthier
Copy link
Contributor Author

netthier commented Jun 7, 2023

The issues you've mentioned could be solved with initContainers and Kubernetes Jobs.
However, because of the wide array of possible actions one could want to take to retrieve and apply config files, I'm not sure if it'd be good to implement it as part of kluctl.
If the interface is too specific to certain tasks, you wouldn't be able to do all the things you'd want. If it's too generic you'll just end up writing a Job/initContainer in your deployment.yaml

I also don't think configuration is a special in any sense relative to other applications of Jobs/InitContainers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants