Skip to content

Commit

Permalink
Consolidate RBAC for GitOps
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasVitale committed Sep 8, 2023
1 parent c3578c3 commit c655d30
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
25 changes: 24 additions & 1 deletion package/config/setup-namespaces.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ metadata:
spec:
fromNamespace: #@ data.values.git.secret.namespace

#! RBAC
#! Supply Chains RBAC

---
apiVersion: v1
Expand Down Expand Up @@ -180,4 +180,27 @@ subjects:
- kind: ServiceAccount
name: #@ data.values.service_account

#! GitOps RBAC

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gitops-reconciler
namespace: #@ namespace.name

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: gitops-reconciler
namespace: #@ namespace.name
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: gitops-reconciler

#@ end
24 changes: 23 additions & 1 deletion test/integration/default/01-assert.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ metadata:
tekton.dev/git-0: https://github.com
kapp.k14s.io/create-strategy: fallback-on-update

#! RBAC
#! Supply Chains RBAC
---
apiVersion: v1
kind: ServiceAccount
Expand Down Expand Up @@ -101,3 +101,25 @@ roleRef:
subjects:
- kind: ServiceAccount
name: supply-chain

#! GitOps RBAC
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gitops-reconciler
namespace: test-default

---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: gitops-reconciler
namespace: test-default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: gitops-reconciler

0 comments on commit c655d30

Please sign in to comment.