Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# See the OWNERS docs: https://go.k8s.io/owners

reviewers:
- gbenhaim
- filariow
- sadlerap
- Omeramsc

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
# This ClusterPolicy automatically generates a RoleBinding in all tenant namespaces
# to grant read-only access to the 'konflux-sre' and 'ai-konflux-user-support' groups.
#
# This policy is designed to ensure that these groups have consistent
# visibility across tenant namespaces for monitoring, troubleshooting, or support.

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: generate-konflux-support-read-only-rolebinding
annotations:
policies.kyverno.io/title: "Generate Read-Only RoleBinding for Konflux support and sre Groups"
policies.kyverno.io/category: Multi-Tenancy
policies.kyverno.io/description: >-
This policy automatically generates a RoleBinding in all tenant namespaces.
The RoleBinding binds the 'konflux-sre' and 'ai-konflux-user-support'
groups to the Konflux-specific 'konflux-viewer-user-actions' ClusterRole,
granting them comprehensive read-only access to resources within each tenant namespace,
therefore allowing better, fast and streamlined support.
spec:
background: false
rules:
- name: generate-read-only-rolebinding
match:
any:
- resources:
kinds:
- /v1/Namespace
selector:
matchLabels:
konflux-ci.dev/type: tenant
generate:
generateExisting: true
synchronize: true
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
name: konflux-read-only-binding
namespace: "{{request.object.metadata.name}}"
data:
subjects:
- kind: Group
name: konflux-sre
apiGroup: rbac.authorization.k8s.io
- kind: Group
name: ai-konflux-user-support
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
name: konflux-viewer-user-actions
apiGroup: rbac.authorization.k8s.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namePrefix: konflux-rbac-
resources:
- generate-support-viewer-rolebinding-clusterpolicy.yaml
- kyverno_rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kyverno-admission:generate-support-viewer-rolebinding
labels:
rbac.kyverno.io/aggregate-to-admission-controller: "true"
rules:
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
verbs:
- list
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kyverno-background:manage-support-rolebindings
labels:
rbac.kyverno.io/aggregate-to-background-controller: "true"
rules:
- apiGroups:
- rbac.authorization.k8s.io
resources:
- rolebindings
verbs:
- create
- get
- list
- delete
- update
---
# To allow kyverno to create the RoleBinding,
# the kyverno-background-controller's ServiceAccount
# needs to have the same permissions it wants to assign
# to someone else
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kyverno-background:konflux-viewer-user-actions
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: konflux-viewer-user-actions
subjects:
- kind: ServiceAccount
namespace: konflux-kyverno
name: kyverno-background-controller
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- bootstrap-tenant-namespace/
- konflux-support-viewer-access/
- restrict-binding-system-authenticated/
- restrict-binding-system-authenticated-releng/
- validate-rolebindings/
Expand Down
Loading