You can get YAML from the kubectl create configmap command and pipe it to kubectl apply, like this:
kubectl create configmap foo --from-file foo.properties -o yaml --dry-run | kubectl apply -f -
You can get YAML from the kubectl create configmap command and pipe it to kubectl apply, like this:
kubectl create configmap foo --from-file foo.properties -o yaml --dry-run | kubectl apply -f -