I am using the following command to create a configMap.
kubectl create configmap test --from-file=./application.properties --from-file=./mongo.properties --from-
Another option is actually you can use this command:
kubectl create configmap some-config --from-file=some-key=some-config.yaml -n some-namespace -o yaml --dry-run | kubectl apply -f -
Refer to Github issue: Support updating config map and secret with --from-file