<p>i am trying to create mongodb-replicaset with kubernetes-helm on digitalocean using do-block-storage. since mongodb recommended to use xfs format, i try to format do-block-storage with xfs using configuration like below, but it seem didn't work. can you help? thank you.</p>

<pre><code>persistentVolume:
  enabled: true
  ## mongodb-replicaset data Persistent Volume Storage Class
  ## If defined, storageClassName: &lt;storageClass&gt;
  ## If set to "-", storageClassName: "", which disables dynamic provisioning
  ## If undefined (the default) or set to null, no storageClassName spec is
  ##   set, choosing the default provisioner.  (gp2 on AWS, standard on
  ##   GKE, AWS &amp; OpenStack)
  ##
  storageClass: "do-block-storage"
  accessModes:
    - ReadWriteOnce
  size: 10Gi
  parameters:
    fsType: xfs
  annotations: {}
</code></pre>

<p>There are two issues with your custom parameters (values.yaml):</p>

<ol>
<li>MongoDB stable Helm chart does not know anything about user-defined field: "parameters". This is because it simply is not defined in any template file (mongodb/templates/*.yaml). In your case Helm will render a similar file to this:</li>
</ol>

<blockquote>
  <p><code>volumeClaimTemplates:
      - metadata:
          name: datadir
          annotations:
        spec:
          accessModes:
            - "ReadWriteOnce"
          resources:
            requests:
              storage: "10Gi"
          storageClassName: "do-block-storage"</code></p>
</blockquote>

<ol start="2">
<li>You can't specify "fsType" in volumeClaimTemplates, although it was once requested (see <a href="https://github.com/kubernetes/kubernetes/issues/44478" rel="nofollow noreferrer">this</a> github issue).</li>
</ol>

<p>I can see two possible workarounds for your issue:</p>

<ol>
<li>Use a separate StorageClass, with default xfs filesystem format, and then reference its name in helm chart`s values, e.g. create <strong>do-block-storage-xfs</strong> StorageClass liek this:</li>
</ol>

<blockquote>
  <p><code>kind: StorageClass
  apiVersion: storage.k8s.io/v1
  metadata:
    name: do-block-storage-xfs
    namespace: kube-system
    annotations:
      storageclass.kubernetes.io/is-default-class: "true"
  provisioner: com.digitalocean.csi.dobs
  parameters:
    fstype: xfs</code></p>
</blockquote>

<ol start="2">
<li>Create in advance a Persistent Volume in DigitalOcean of xfs fsType &amp; PVC in K8S, and reference it as an existing PVC in the Helm chart (see <em>persistence.existingClaim</em> configurable parameter <a href="https://github.com/helm/charts/tree/master/stable/mongodb" rel="nofollow noreferrer">here</a>)</li>
</ol>
