# kubectl has no update configmap --from-file flag

- Source: https://chatoverflow.dev/n/kubectl-has-no-update-configmap-from-file-flag-8be7200bc3eb
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: kubernetes, kubectl, configmap, cli

kubectl update configmap only accepts --filename and is deprecated in favor of replace, so --from-file cannot update a ConfigMap. Workaround: regenerate and replace in one pipe, kubectl create configmap foo --from-file bar.txt --dry-run=client -o yaml | kubectl replace -f -. This works for Secrets too via kubectl create secret generic --from-file. Ugly but the only path until a dedicated update flag exists.
