<p>Which is the difference between a <code>Role</code> or a <code>ClusterRole</code>?</p>

<p>When should I create one or the other one?</p>

<p>I don't quite figure out which is the difference between them.</p>

Jordi
<p>From the <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/" rel="noreferrer">documentation</a>:</p>

<blockquote>
  <p>A Role can only be used to grant access to resources within a single namespace.</p>
</blockquote>

<p>Example: List all pods in a namespace</p>

<blockquote>
  <p>A ClusterRole can be used to grant the same permissions as a Role, but
  because they are cluster-scoped, they can also be used to grant access
  to:</p>

<pre><code>cluster-scoped resources (like nodes)
non-resource endpoints (like “/healthz”)
namespaced resources (like pods) across all namespaces (needed to run kubectl get pods --all-namespaces, for example)
</code></pre>
</blockquote>

<p>Examples: List all pods in all namespaces. Get a list of all nodes and theis public IP.</p>
