Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cozystack-cluster-admin #517

Merged
merged 4 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
13 changes: 13 additions & 0 deletions packages/system/keycloak-configure/templates/configure-kk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,3 +225,16 @@ spec:
realmRef:
name: keycloakrealm-cozy
kind: ClusterKeycloakRealm

---

apiVersion: v1.edp.epam.com/v1
kind: KeycloakRealmGroup
metadata:
name: cozystack-cluster-admin
namespace: cozy-dashboard
klinch0 marked this conversation as resolved.
Show resolved Hide resolved
spec:
name: cozystack-cluster-admin
realmRef:
name: keycloakrealm-cozy
kind: ClusterKeycloakRealm
kvaps marked this conversation as resolved.
Show resolved Hide resolved
34 changes: 33 additions & 1 deletion packages/system/keycloak-configure/templates/rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,40 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: admin
name: kubeapps-admin
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: kubeapps-admin

---

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: kubeapps-admin
namespace: cozy-public
kvaps marked this conversation as resolved.
Show resolved Hide resolved
subjects:
- kind: Group
name: kubeapps-admin
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: kubeapps-admin
apiGroup: rbac.authorization.k8s.io

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cozystack-cluster-admin-group
namespace: cozy-dashboard
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Remove unnecessary namespace field

ClusterRoleBinding is cluster-scoped, so the namespace field has no effect and should be removed.

 metadata:
   name: cozystack-cluster-admin-group
-  namespace: cozy-dashboard
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
metadata:
name: cozystack-cluster-admin-group
namespace: cozy-dashboard
metadata:
name: cozystack-cluster-admin-group

klinch0 marked this conversation as resolved.
Show resolved Hide resolved
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cozystack-cluster-admin
subjects:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: cozystack-cluster-admin
kvaps marked this conversation as resolved.
Show resolved Hide resolved
57 changes: 57 additions & 0 deletions packages/system/keycloak-configure/templates/roles.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kubeapps-admin
rules:
- apiGroups: [""]
resources:
- "*"
verbs:
- get
- list
- watch
- apiGroups: ["apps.cozystack.io"]
resources:
- '*'
verbs:
- '*'
- apiGroups: ["helm.toolkit.fluxcd.io"]
resources:
- helmreleases
verbs:
- '*'
---
kvaps marked this conversation as resolved.
Show resolved Hide resolved

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: kubeapps-admin
namespace: cozy-public
kvaps marked this conversation as resolved.
Show resolved Hide resolved
rules:
- apiGroups: ["source.toolkit.fluxcd.io"]
resources: ["helmrepositories"]
verbs:
- get
- list
- apiGroups: ["source.toolkit.fluxcd.io"]
resources:
- helmcharts
verbs: ["*"]

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cozystack-cluster-admin
rules:
- apiGroups:
- '*'
resources:
- '*'
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- '*'
kvaps marked this conversation as resolved.
Show resolved Hide resolved