<p>I'm following a tutorial by <a href="https://medium.com/@diegomrtnzg/secure-your-kubernetes-services-by-using-https-connections-63fa102a90c2" rel="nofollow noreferrer">Diego Martínez</a>, outlining how to use an ingress controller with SSL on K8s. Everything works fine, with the exception of an RBAC error:</p>

<p><code>It seems the cluster it is running with Authorization enabled (like RBAC) and there is no permissions for the ingress controller. Please check the configuration</code></p>

<p>Does anyone know how I can grant RBAC permissions to this resource?</p>

<p>I'm running on Google Cloud, and for reference, below is the ingress deployment spec</p>

<p><a href="https://i.stack.imgur.com/N28J6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N28J6.png" alt="Ingress Deployment"></a></p>

Ben Toogood
<p>If you are deploying nginx-ingress, perhaps the <a href="https://github.com/helm/charts/tree/master/stable/nginx-ingress" rel="nofollow noreferrer">nginx-ingress Helm chart</a> is a simpler way to do it.</p>
<p>You can follow <a href="https://kubernetes.github.io/ingress-nginx/deploy/" rel="nofollow noreferrer">the guide</a> on the nginx-ingress documentation installation on RBAC-enabled clusters.</p>
<p>Specifically addressing your question regarding adding the RBAC permissions, you will need to add something like:</p>
<pre><code>---
  apiVersion: v1
  kind: ServiceAccount
  metadata:
    name: nginx-ingress-serviceaccount
    namespace: ingress-nginx
    labels:
      app.kubernetes.io/name: ingress-nginx
      app.kubernetes.io/part-of: ingress-nginx
  
  ---
  apiVersion: rbac.authorization.k8s.io/v1beta1
  kind: ClusterRole
  metadata:
    name: nginx-ingress-clusterrole
    labels:
      app.kubernetes.io/name: ingress-nginx
      app.kubernetes.io/part-of: ingress-nginx
  rules:
    - apiGroups:
        - &quot;&quot;
      resources:
        - configmaps
        - endpoints
        - nodes
        - pods
        - secrets
      verbs:
        - list
        - watch
    - apiGroups:
        - &quot;&quot;
      resources:
        - nodes
      verbs:
        - get
    - apiGroups:
        - &quot;&quot;
      resources:
        - services
      verbs:
        - get
        - list
        - watch
    - apiGroups:
        - &quot;extensions&quot;
      resources:
        - ingresses
      verbs:
        - get
        - list
        - watch
    - apiGroups:
        - &quot;&quot;
      resources:
        - events
      verbs:
        - create
        - patch
    - apiGroups:
        - &quot;extensions&quot;
      resources:
        - ingresses/status
      verbs:
        - update
  
  ---
  apiVersion: rbac.authorization.k8s.io/v1beta1
  kind: Role
  metadata:
    name: nginx-ingress-role
    namespace: ingress-nginx
    labels:
      app.kubernetes.io/name: ingress-nginx
      app.kubernetes.io/part-of: ingress-nginx
  rules:
    - apiGroups:
        - &quot;&quot;
      resources:
        - configmaps
        - pods
        - secrets
        - namespaces
      verbs:
        - get
    - apiGroups:
        - &quot;&quot;
      resources:
        - configmaps
      resourceNames:
        # Defaults to &quot;&lt;election-id&gt;-&lt;ingress-class&gt;&quot;
        # Here: &quot;&lt;ingress-controller-leader&gt;-&lt;nginx&gt;&quot;
        # This has to be adapted if you change either parameter
        # when launching the nginx-ingress-controller.
        - &quot;ingress-controller-leader-nginx&quot;
      verbs:
        - get
        - update
    - apiGroups:
        - &quot;&quot;
      resources:
        - configmaps
      verbs:
        - create
    - apiGroups:
        - &quot;&quot;
      resources:
        - endpoints
      verbs:
        - get
  
  ---
  apiVersion: rbac.authorization.k8s.io/v1beta1
  kind: RoleBinding
  metadata:
    name: nginx-ingress-role-nisa-binding
    namespace: ingress-nginx
    labels:
      app.kubernetes.io/name: ingress-nginx
      app.kubernetes.io/part-of: ingress-nginx
  roleRef:
    apiGroup: rbac.authorization.k8s.io
    kind: Role
    name: nginx-ingress-role
  subjects:
    - kind: ServiceAccount
      name: nginx-ingress-serviceaccount
      namespace: ingress-nginx
  
  ---
  apiVersion: rbac.authorization.k8s.io/v1beta1
  kind: ClusterRoleBinding
  metadata:
    name: nginx-ingress-clusterrole-nisa-binding
    labels:
      app.kubernetes.io/name: ingress-nginx
      app.kubernetes.io/part-of: ingress-nginx
  roleRef:
    apiGroup: rbac.authorization.k8s.io
    kind: ClusterRole
    name: nginx-ingress-clusterrole
  subjects:
    - kind: ServiceAccount
      name: nginx-ingress-serviceaccount
      namespace: ingress-nginx
</code></pre>
