<p>I'm trying to grant the default service account in my namespace the ability to read ingress resources. I want to be able to read all ingress resources for the cluster, would that necessitate a ClusterRole? This is the role and binding I've been trying.
The kubectl command <code>kubectl auth can-i list ingress -n my-namespace --as=system:serviceaccount:my-namespace:default</code> also returns &quot;no&quot;</p>
<pre><code>apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  namespace: my-namespace
  name: my-ingress-reader
rules:
- apiGroups: [&quot;&quot;, &quot;networking.k8s.io&quot;, &quot;networking&quot;, &quot;extensions&quot;] # &quot;&quot; indicates the core API group
  resources: [&quot;ingress&quot;]
  verbs: [&quot;get&quot;, &quot;watch&quot;, &quot;list&quot;]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: my-ingress-reader
  namespace: my-namespace
subjects:
- kind: ServiceAccount
  name: default
  namespace: my-namespace
roleRef:
  kind: Role
  name: my-ingress-reader
  apiGroup: rbac.authorization.k8s.io
</code></pre>

<h3>your <code>Role rules</code> is using incorrect api-resources that is <code>resources: [&quot;ingress&quot;]</code>,  it must be <code>resources: [&quot;ingresses&quot;]</code></h3>
<pre><code>apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  namespace: my-namespace
  name: my-ingress-reader
rules:
- apiGroups: [&quot;&quot;, &quot;networking.k8s.io&quot;, &quot;networking&quot;, &quot;extensions&quot;] # &quot;&quot; indicates the core API group
  resources: [&quot;ingresses&quot;]
  verbs: [&quot;get&quot;, &quot;watch&quot;, &quot;list&quot;]
</code></pre>
<h3>to check the correct api-resources, you can use below command</h3>
<pre><code>root@controlplane:~# kubectl api-resources | grep -i ingress
ingresses                         ing          extensions/v1beta1                     true         Ingress
ingressclasses                                 networking.k8s.io/v1                   false        IngressClass
ingresses                         ing          networking.k8s.io/v1                   true         Ingress
</code></pre>
