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

tool to update a file in a configmap or generic secret #25832

Closed
jmhodges opened this issue May 18, 2016 · 7 comments
Closed

tool to update a file in a configmap or generic secret #25832

jmhodges opened this issue May 18, 2016 · 7 comments
Labels
area/configmap-api area/kubectl kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/node Categorizes an issue or PR as relevant to SIG Node.

Comments

@jmhodges
Copy link

I have some configmap and secrets that contain binary data. Downloading the configmap, and editing it by hand to update the data in them is perilous.

One current alternative is deleting and recreating the configmap but it's easy to forget you deleted it or screw up the replace and wander off for lunch while a deploy occurs which then breaks.

Another alternative is making a new configmap with a new path and then updating the deployments that need to use it. This seems a little too onerous and involves making the kubernetes user encode some version information into their configmap names which seems fragile.

It would be nice to get a replace like command but that was for updating a key in the config-map with a similar --from-file interface as create config-map so that the user doesn't screw up the encoding in the file.

(I've used "configmap" above, but all of the same issues occur for secrets, as well).

@lavalamp lavalamp added team/ux kind/feature Categorizes issue or PR as related to a new feature. labels May 19, 2016
@sgrimee
Copy link

sgrimee commented May 19, 2016

I was given this trick on the slack channel:
kubectl create configmap nginx-lb-config --from-file=nginx-lb.configmap --dry-run -o yaml | kubectl replace configmap nginx-lb-config -f -

@pwittrock pwittrock added the priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. label May 23, 2016
@jmhodges
Copy link
Author

Oh, while I'm back here to look this up again, I should note using that command doesn't prevent you from accidentally replacing a configmap that's been modified while you weren't looking.

Not sure how to make that happen from the command line without a bunch of base64 and kubectl patch work.

@derekmahar
Copy link
Contributor

@jmhodges As an aside, can a container read a binary file from a volume to which is mapped a Kubernetes ConfigMap that contains that binary file? Please see http://stackoverflow.com/questions/39420102/does-kubernetes-support-a-binary-file-in-a-configmap.

@liggitt
Copy link
Member

liggitt commented Sep 11, 2016

config maps are text-only, I believe. @pmorie can confirm/deny

@bgrant0607
Copy link
Member

Support for binary in configmaps was requested in #32432.

@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label May 31, 2017
@0xmichalis
Copy link
Contributor

/sig node
/sig cli

@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. sig/cli Categorizes an issue or PR as relevant to SIG CLI. labels Jun 21, 2017
@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jun 21, 2017
@bgrant0607
Copy link
Member

Closing this as a dupe of #30558 (updates of ConfigMap and Secret) and #32432 (support for binary data in ConfigMap).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configmap-api area/kubectl kind/feature Categorizes issue or PR as related to a new feature. priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/node Categorizes an issue or PR as relevant to SIG Node.
Projects
None yet
Development

No branches or pull requests

10 participants