# deploy/multitenant/rbac.yaml # # RBAC required for the Fission multi-tenant NSWatcher components. # # Both fission-executor and fission-router must be allowed to list and watch # Namespaces at the cluster scope so that their NSWatchers can detect newly- # labeled Namespaces. # # The executor also needs additional write permissions to provision the # fission-fetcher ServiceAccount/Role/RoleBinding in new namespaces. # Apply once per cluster after installing Fission: # # kubectl apply -f deploy/multitenant/rbac.yaml # --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: fission-executor-ns-watcher labels: app.kubernetes.io/name: fission app.kubernetes.io/component: executor app.kubernetes.io/part-of: fission-multitenant rules: - apiGroups: [""] resources: ["namespaces"] verbs: ["list", "watch"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: fission-executor-ns-watcher labels: app.kubernetes.io/name: fission app.kubernetes.io/component: executor app.kubernetes.io/part-of: fission-multitenant roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: fission-executor-ns-watcher subjects: - kind: ServiceAccount name: fission-executor namespace: fission --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: fission-router-ns-watcher labels: app.kubernetes.io/name: fission app.kubernetes.io/component: router app.kubernetes.io/part-of: fission-multitenant rules: - apiGroups: [""] resources: ["namespaces"] verbs: ["list", "watch"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: fission-router-ns-watcher labels: app.kubernetes.io/name: fission app.kubernetes.io/component: router app.kubernetes.io/part-of: fission-multitenant roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: fission-router-ns-watcher subjects: - kind: ServiceAccount name: fission-router namespace: fission --- # ClusterRole: allows fission-executor to create/update fission-fetcher SA, # Role and RoleBinding in any user namespace managed by NSWatcher. # # It also needs two less-obvious permissions: # 1. localsubjectaccessreviews.create — setupSAAndRoleBindings checks whether # the target SA already has each permission before creating missing rules. # 2. events.create — Kubernetes forbids creating a Role that grants permissions # the caller does not currently hold. Since fission-fetcher gets events.create, # fission-executor must hold it too in order to create that Role. apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: fission-executor-sa-provisioner labels: app.kubernetes.io/name: fission app.kubernetes.io/component: executor app.kubernetes.io/part-of: fission-multitenant rules: - apiGroups: [""] resources: ["serviceaccounts"] verbs: ["get", "list", "watch", "create", "update", "patch"] - apiGroups: [""] resources: ["events"] verbs: ["create"] - apiGroups: ["authorization.k8s.io"] resources: ["localsubjectaccessreviews"] verbs: ["create"] - apiGroups: ["rbac.authorization.k8s.io"] resources: ["roles", "rolebindings"] verbs: ["get", "list", "watch", "create", "update", "patch"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: fission-executor-sa-provisioner labels: app.kubernetes.io/name: fission app.kubernetes.io/component: executor app.kubernetes.io/part-of: fission-multitenant roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: fission-executor-sa-provisioner subjects: - kind: ServiceAccount name: fission-executor namespace: fission