title: Kubernetes - ClusterRole with namespace is allowed?
body: <p>The <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/#role-and-clusterrole" rel="nofollow noreferrer">documentation</a> says,</p>
  <blockquote>
  <p>If you want to define a role within a namespace, use a <code>Role</code>; if you want to define a role cluster-wide, use a <code>ClusterRole</code>.</p>
  </blockquote>
  <p>So, why am I able to create a <code>ClusterRole</code> in a namespace for a non-namespaced resource <code>StorageClass</code> (or, <code>sc</code> in short)?</p>
  <pre class="lang-sh prettyprint-override"><code>kubectl -n apps create clusterrole scrole --verb=create,update,patch,delete --resource=sc
  </code></pre>
  <p>Also, is it correct to say that, a <code>Role</code> is applicable for namespaced resources <em>only</em> and <code>ClusterRole</code> for non-namespaced resources <em>only</em>?</p>