config map are use to share data with key values so you can inject the config map inside a config to share data like env variable.
crée la config map sans aucun fichier
kubectl create configmap <config-name> --from-literal=<key>=<value>
exemple
kubectl create configmap nginx --from-literal=LISTEN_PORT_HTTPS=444 \
--from-literal=LISTEN_PORT_HTTP=88
crée la config map avec un fichier properties
kubectl create configmap nginx --from-file=<path-to-file>
exemple
kubectl create configmap nginx --from-file=nginx.properties
crée un fichier yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx
data:
<key> : <value>
LISTEN_PORT_HTTP: 88
LISTEN_PORT_HTTPS: 444
kubectl apply -f <path-to-file>
to include a config to an other pod deployement or replicat
you just have to change a little the yaml file
see more here