Permissions

January 13, 2025 ยท View on GitHub

The open feature operator uses the open-feature-operator-controller-manager service account, this service account contains the following RoleBindings:

  • open-feature-operator-leader-election-role (role name: leader-election-role)
  • open-feature-operator-manager-role (role name: manager-role)
  • open-feature-operator-proxy-role (role name: proxy-role)
  • open-feature-operator-flagd-kubernetes-sync (role name: flagd-kubernetes-sync)

Leader Election Role

The leader-election-role provides the operator with the required permissions to perform leader election. The definition of this role can be found here

API GroupResourceVerbs
-ConfigMapcreate, delete, get, list, patch, update, watch
-Eventcreate, patch,
coordination.k8s.ioLeasecreate, delete, get, list, patch, update, watch

Manager Role

The manager-role applies the rules described below, its definition can be found here. It provides the operator with sufficient permissions over the core.openfeature.dev resources, the required permissions for injecting the flagd sidecar into appropriate pods, and managing flagd-proxy resources The ConfigMap permissions are needed to allow the mounting of FeatureFlag resources for file syncs.

API GroupResourceVerbs
-ConfigMapcreate, delete, get, list, patch, update, watch
-Podcreate, delete, get, list, patch, update, watch
-ServiceAccountget, list, watch
-Service (*)create, delete, get, list, patch, update, watch
policyPodDisruptionBudgetcreate, delete, get, list, patch, update, watch
networking.k8s.ioIngress (*)create, delete, get, list, patch, update, watch
gateway.networking.k8s.ioHttpRoutecreate, delete, get, list, patch, update, watch
core.openfeature.devFeatureFlagcreate, delete, get, list, patch, update, watch
core.openfeature.devFeatureFlag Finalizersupdate
core.openfeature.devFeatureFlag Statusget, patch, update
core.openfeature.devFeatureFlagSourcecreate, delete, get, list, patch, update, watch
core.openfeature.devFeatureFlagSource Finalizersget, update
core.openfeature.devFeatureFlagSource Statusget, patch, update
core.openfeature.devFlagdcreate, delete, get, list, patch, update, watch
core.openfeature.devFlagd Finalizersupdate
core.openfeature.devInProcessConfigurationcreate, delete, get, list, patch, update, watch
rbac.authorization.k8s.ioClusterRoleBindingget, list, update, watch

Proxy Role

The proxy-role definition can be found here

API GroupResourceVerbs
authentication.k8s.ioToken Reviewcreate
authentication.k8s.ioSubject Access Reviewcreate

Flagd Kubernetes Sync

The flagd-kubernetes-sync role providers the permission to get, watch and list all core.openfeature.dev resources, permitting the kubernetes sync feature in injected flagd containers. Its definition can be found here. During startup the operator will backfill permissions to the flagd-kubernetes-sync cluster role binding from the current state of the cluster, adding all service accounts from pods with the core.openfeature.dev/enabled annotation set to "true", preventing unexpected behavior during upgrades.

API GroupResourceVerbs
core.openfeature.devFeatureFlagSourceget, watch, list
core.openfeature.devFeatureFlagget, watch, list

When a Pod has the core.openfeature.dev/enabled annotation value set to "true", its Service Account is added as a subject for this role's Role Binding, granting it all required permissions for watching its associated FeatureFlags. As a result flagd can provide real time events describing flag definition changes.