Kubernetes JSONPath and Kustomize Cheat Sheet/Generate configmap YAML dry-run

Generate YAML that can be committed into Kustomize overlays.

Section: Kustomize with kubectl

Generate configmap YAML dry-run

bash
bash
kubectl create configmap app-config --from-file=app.env -o yaml --dry-run=client
Explanation

Generate YAML that can be committed into Kustomize overlays.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Kustomize with kubectl
Render kustomization
Build a kustomization without applying it.
OpenIn sheetbashsame section
Apply kustomization
Apply resources from a kustomization directory.
OpenIn sheetbashsame section
Delete kustomized resources
Delete resources generated by a kustomization.
OpenIn sheetbashsame section
Diff kustomized resources
Preview the changes from a kustomization.
OpenIn sheetbashsame section
Apply and prune kustomization
Apply a kustomization and prune matching managed objects.
OpenIn sheetbashsame section
Search YAML output
Extract YAML fields with yq.
OpenIn sheetbash1 tag match