examples
examples copied to clipboard
Error: unknown flag: --from-file
Hey! When I run this command from the book for example 14-3:
kubectl apply cm --from-file ghost-config.js ghost-config
I get this error:
Error: unknown flag: --from-file
I'm on kubectl version:
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.3", GitCommit:"f0efb3cb883751c5ffdbe6d515f3cb4fbe7b7acd", GitTreeState:"clean", BuildDate:"2017-11-08T18:39:33Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"dirty", BuildDate:"2017-06-22T04:31:09Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Do I need to be on an older version for that invocation to work?
For anyone else with this problem, I used this command to get it working:
kubectl create configmap ghost-config --from-file ghost-config.js
Thanks so much for making this correction!
Thanks for posting this work-around for this error in the book!
@ftripier ,
kubectl create configmap ghost-config --from-file ghost-config.js
This command would fail if a configmap ghost-config already exists.
kubectl apply is used mainly to update resources if there is change in manifests. So how can we update an existing configmap ?
@karthikc911, I know this issue isn't too fresh, but I'll post this here anyways for future readers. You could try to do something like this: https://blog.atomist.com/updating-a-kubernetes-secret-or-configmap/
Looks like this has been addressed. Feel free to reopen if that's not the case.