<p>I don't see an option to mount a configMap as volume in the statefulset , as per <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#statefulset-v1-apps" rel="noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#statefulset-v1-apps</a> only PVC can be associated with "StatefulSet" . But PVC does not have option for configMaps.</p>

<p>Here is a minimal example:</p>

<pre><code>apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: example
spec:
  selector:
    matchLabels:
      app: example
  serviceName: example
  template:
    metadata:
      labels:
        app: example
    spec:
      containers:
        - name: example
          image: nginx:stable-alpine
          volumeMounts:
            - mountPath: /config
              name: example-config
      volumes:
        - name: example-config
          configMap:
            name: example-configmap
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: example-configmap
data:
  a: "1"
  b: "2"
</code></pre>

<p>In the container, you can find the files <code>a</code> and <code>b</code> under <code>/config</code>, with the contents <code>1</code> and <code>2</code>, respectively.</p>

<p>Some explanation: 
You do not need a PVC to mount the configmap as a volume to your pods. <code>PersistentVolumeClaim</code>s are persistent drives, which you can read from/write to. An example for their usage is a database, such as Postgres.</p>

<p><code>ConfigMap</code>s on the other hand are read-only key-value structures that are stored inside Kubernetes (in its etcd store), which are to store the configuration for your application. Their values can be mounted as environment variables or as files, either individually or altogether.</p>
