forked from ovn-org/ovn-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit refactors the RBAC rules and serviceAccount ovn-kubernetes uses. Instead of using one ServiceAcoount with one ClusterRole break it down per component. This makes it easier to track which permissions are required by which piece and avoid the mess of granting high privilages to everyone. Signed-off-by: Patryk Diak <[email protected]>
- Loading branch information
Showing
16 changed files
with
477 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: ovnkube-cluster-manager | ||
namespace: ovn-kubernetes | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: ovnkube-cluster-manager | ||
roleRef: | ||
name: ovnkube-cluster-manager | ||
kind: ClusterRole | ||
apiGroup: rbac.authorization.k8s.io | ||
subjects: | ||
- kind: ServiceAccount | ||
name: ovnkube-cluster-manager | ||
namespace: ovn-kubernetes | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: ovnkube-cluster-manager-configmaps | ||
namespace: ovn-kubernetes | ||
roleRef: | ||
name: ovn-k8s-configmap | ||
kind: Role | ||
apiGroup: rbac.authorization.k8s.io | ||
subjects: | ||
- kind: ServiceAccount | ||
name: ovnkube-cluster-manager | ||
namespace: ovn-kubernetes | ||
|
||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: ovnkube-cluster-manager | ||
rules: | ||
- apiGroups: [""] | ||
resources: | ||
- namespaces | ||
- nodes | ||
- pods | ||
- services | ||
- endpoints | ||
verbs: [ "get", "list", "watch" ] | ||
- apiGroups: ["discovery.k8s.io"] | ||
resources: | ||
- endpointslices | ||
verbs: [ "get", "list", "watch" ] | ||
- apiGroups: ["k8s.cni.cncf.io"] | ||
resources: | ||
- network-attachment-definitions | ||
- multi-networkpolicies | ||
verbs: ["list", "get", "watch"] | ||
- apiGroups: ["k8s.ovn.org"] | ||
resources: | ||
- egressips | ||
- egressservices | ||
verbs: [ "get", "list", "watch" ] | ||
- apiGroups: ["k8s.ovn.org"] | ||
resources: | ||
- egressips | ||
- egressservices/status | ||
verbs: [ "patch", "update" ] | ||
- apiGroups: [""] | ||
resources: | ||
- events | ||
verbs: ["create", "patch", "update"] | ||
- apiGroups: [""] | ||
resources: | ||
- pods/status # used in multi-homing: https://github.com/ovn-org/ovn-kubernetes/blob/a9beb6fd4f8ea32b264999a8ebec25cd6bdc2281/go-controller/pkg/util/pod.go#L49 | ||
- nodes/status | ||
- services/status | ||
verbs: [ "patch", "update" ] |
Oops, something went wrong.