Here is an example of a Kubernetes ConfigMap YAML file:
apiVersion: v1
kind: ConfigMap
metadata:
name: my-configmap
data:
username: admin
password: secret
In this example, we are creating a ConfigMap called “my-configmap” with two data entries - “username” and “password”. These values can be accessed by pods running in the same namespace as the ConfigMap by referencing the ConfigMap’s name and key. For example, if a pod wanted to access the “username” value, it would reference it like this: $(CONFIGMAP_NAME).data.username
.