<p>I am new to Kubernetes, and have a question about it. </p>

<p>When we create a statefulset, it gets associated with its PVC and the PVC will be associated a storageclass.    </p>

<p>So when we execute command "kubectl delete namespace", should it delete the storageclasses also?</p>

<p>P.S. The cluster is running on AWS.</p>

<p><strong>Not All Objects are in a Namespace</strong></p>
<p>Most Kubernetes resources (e.g. pods, services, replication controllers, and others) are in some namespaces. And low-level resources, such as nodes and persistentVolumes, are not in any namespace. <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#a-note-on-namespaces" rel="nofollow noreferrer">Source.</a></p>
<p>The storage class is not a namespace object.
Try to run <code>$ kubectl get storageclass --all-namespaces</code> and you will notice that there is not even the indication of the namespace:</p>
<pre><code>xxx@xxxxx.xx:~$ kubectl get storageclass --all-namespaces
    
NAMESPACE   NAME                 PROVISIONER
            slow                 kubernetes.io/gce-pd
            standard (default)   kubernetes.io/gce-pd
</code></pre>
<p>Therefore I have never paid attention, but I believe that if you delete a namespace nothing will happen to the Storage class objects.</p>
<p><strong>Update:</strong></p>
<p>I created a namespace class &quot;paolo&quot; the following StorageClass:</p>
<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: slow
  namespace: paolo
provisioner: kubernetes.io/gce-pd
parameters:
  type: pd-standard
  zones: us-central1-a, us-central1-b
</code></pre>
<p>I didn't received any error, I deleted the namespace paolo and as expected the StorageClass was still there</p>
<p>My test has been performed on Google Cloud Platform.</p>
