<p>According to the documentation <a href="https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/</a> if wi want to change the default Storage Class we should patch it. </p>

<p>Template to create new Storage Class</p>

<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: encrypted
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2
  fsType: ext4
  encrypted: true
</code></pre>

<p>I have tried to add to the template:</p>

<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: gp2
  annotations:
    storageclass.kubernetes.io/is-default-class: "false"
provisioner: kubernetes.io/aws-ebs
</code></pre>

<p>And got an error: <code>gp2 already exist</code></p>

<p>How to patch/update default Storage Class (make it non-default) with Helm template?</p>

Yurii
<p>Helm can only manage resources created by itself, and you are trying to alter an already existing resource. You can either:</p>

<ul>
<li>delete the gp2 storage class before applying the chart and helm will recreate it</li>
<li>delete the gp2 template from your chart, and patch the gp2 storage class manually before applying the chart</li>
</ul>
