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

Mount ConfigMap as JSON file #80106

Closed
chrisjohnson opened this issue Jul 12, 2019 · 9 comments
Closed

Mount ConfigMap as JSON file #80106

chrisjohnson opened this issue Jul 12, 2019 · 9 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/node Categorizes an issue or PR as relevant to SIG Node.

Comments

@chrisjohnson
Copy link

chrisjohnson commented Jul 12, 2019

What would you like to be added:
In our environment, we use JSON files as the interchange for config rather than a dozen ENV variables. So we fetch and build the config map inside terraform, and then when we go to create a ConfigMap to be given to the pod, we have to first serialize to JSON within terraform so we end up with a ConfigMap that looks like this:

data:
  configuration.json: |
    {"json": "blob"}

It would be great if k8s saw a non-scalar value at data in the manifest, it would first serialize it. How exactly to serialize is not super obvious to me, do you select serialization format based on the key ending in .json? Do you add an attribute to specify how to serialize? Do you always use JSON? Maybe you specify this during the volumeMounts bit? I'm not sure what best fits the overall project.

Why is this needed:
Storing a map as a string in a ConfigMap is icky, it would be nicer if the ConfigMap could just directly house the data as an object and then when it goes to mount in, that's when the conversion happens

@chrisjohnson chrisjohnson added the kind/feature Categorizes issue or PR as related to a new feature. label Jul 12, 2019
@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. sig/apps Categorizes an issue or PR as relevant to SIG Apps. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 12, 2019
@chrisjohnson
Copy link
Author

I guessed at the SIG, feel free to re-assign

@kow3ns
Copy link
Member

kow3ns commented Jul 15, 2019

/remove-sig apps

@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. and removed sig/apps Categorizes an issue or PR as relevant to SIG Apps. labels Jul 15, 2019
@kow3ns
Copy link
Member

kow3ns commented Jul 15, 2019

/sig node

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 15, 2019
@kow3ns
Copy link
Member

kow3ns commented Jul 15, 2019

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jul 15, 2019
@fedebongio
Copy link
Contributor

/remove-sig api-machinery

@k8s-ci-robot k8s-ci-robot removed the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jul 15, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 13, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 12, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. sig/node Categorizes an issue or PR as relevant to SIG Node.
Projects
None yet
Development

No branches or pull requests

5 participants