Define restricted and cluster admin SAs

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan 2024-04-10 09:29:13 +03:00
parent b8466506b8
commit ce8815b1d9
No known key found for this signature in database
GPG key ID: 3299AEB0E4085BAF
4 changed files with 39 additions and 16 deletions

View file

@ -0,0 +1,37 @@
apiVersion: v1
kind: Namespace
metadata:
name: staging
labels:
toolkit.fluxcd.io/tenant: admin-team
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
toolkit.fluxcd.io/tenant: admin-team
name: flux-restricted
namespace: staging
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
toolkit.fluxcd.io/tenant: admin-team
name: flux-cluster-admin
namespace: staging
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
toolkit.fluxcd.io/tenant: admin-team
name: flux-cluster-admin
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: flux-cluster-admin
namespace: staging

View file

@ -20,5 +20,5 @@ roleRef:
name: cluster-admin name: cluster-admin
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: flux-apps name: flux-restricted
namespace: staging namespace: staging

View file

@ -1,14 +0,0 @@
apiVersion: v1
kind: Namespace
metadata:
name: staging
labels:
toolkit.fluxcd.io/tenant: dev-team
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
toolkit.fluxcd.io/tenant: dev-team
name: flux-apps
namespace: staging

View file

@ -53,4 +53,4 @@ spec:
name: cluster-kubeconfig name: cluster-kubeconfig
- op: add - op: add
path: /spec/serviceAccountName path: /spec/serviceAccountName
value: flux-apps value: flux-restricted