This document describes how to deploy BFE Ingress Controller in an environment with RBAC enabled.
Kubernetes use Role-based access control, and define below objects:
-
Define 'role', to set permissions for the role:
ClusterRole
- to define permissions of a role which is cluster-wideRole
- to define permissions of a role which belongs to specific namespace
-
Define 'role binding', to grant permissions defined in a role to a user or set of users:
ClusterRoleBinding
, to grant permissions defined inClusterRole
to userRoleBinding
, to grant permissions defined inRole
to user
To deploy a BFE Ingress Controller instance in an environment with RBAC enabled, use the ServiceAccount
that bound to a ClusterRole
, which has been granted with all permissions BFE Ingress Controller required.
BFE Ingress Controller required at least below permissions:
-
permissions defined for a ClusterRole:
services, endpoints, secrets, namespaces: get, list, watch ingresses, ingressclasses: get, list, watch, update
In controller.yaml :
- define a
ServiceAccount
,- name it as
bfe-ingress-controller
- name it as
- define a BFE Ingress Controller instance deployment
- Instance deployed should be linked to ServiceAccount
bfe-ingress-controller
- Instance deployed should be linked to ServiceAccount
In rbac.yaml :
- define a
ClusterRole
,-
name it as
bfe-ingress-controller
-
grant cluster-wide permissions below to it:
services, endpoints, secrets, namespaces: get, list, watch ingresses, ingressclasses: get, list, watch, update
-
In rbac.yaml :
- define a
ClusterRoleBinding
,- bind ServiceAccount
bfe-ingress-controller
to ClusterRolebfe-ingress-controller
- bind ServiceAccount