<p>I created a kubernetes cluster using Kubeadm and 3 droplets on digitalocean. </p>

<p>...while creating a persistentVolumeClaim for a node-mongodb pod I was working on, using <code>kubectl get storageclass</code>, I tried accessing the default storage class instead I got <code>No resource found</code></p>

<p>I expected this output: </p>

<pre><code>Output
NAME                         PROVISIONER                 AGE
do-block-storage (default)   dobs.csi.digitalocean.com   21m
</code></pre>

<p>This doesn't seem to be the issue when creating a cluster using digitalocean's console.</p>

<p>how do I set a default storage class using <code>kubectl</code> ? </p>

<p>I've tried creating a PVC with reference to the default storage class but since it's not pointing to dobs.csi.digitalocean.com, when I run the configuration and check for created pvcs -</p>

<p><code>kubectl get pvc</code></p>

<pre><code>NAME     STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS       AGE
dbdata   Pending                                      do-block-storage   2m1s
</code></pre>

<p><code>kubectl decribe pvc dbata</code>  </p>

<pre><code>Name:          dbdata
Namespace:     default
StorageClass:  do-block-storage
Status:        Pending
Volume:        
Labels:        io.kompose.service=dbdata
Annotations:   &lt;none&gt;
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Events:
  Type       Reason              Age                  From                         Message
  ----       ------              ----                 ----                         -------
  Warning    ProvisioningFailed  37s (x8 over 2m54s)  persistentvolume-controller  storageclass.storage.k8s.io "do-block-storage" not found
Mounted By:  db-845bd9968b-hrtfw
</code></pre>

<p>~/dbdata-persistedvolumeclaim.yaml file</p>

<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: dbdata
  name: dbdata
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
  storageClassName: do-block-storage
status: {}
</code></pre>

<p>how do I set a default storage class using <code>kubectl</code> ? </p>

Ismail
<p>Since this is not a managed Kubernetes cluster from Digital ocean you need to set it up manually following the docs <a href="https://github.com/digitalocean/csi-digitalocean#installing-to-kubernetes" rel="noreferrer">here</a></p>

<ol>
<li>Create a secret with your DigitalOcean API Access Token</li>
<li>Deploy the CSI plugin and sidecars</li>
</ol>
