Skip to content

Commit

Permalink
Merge pull request #5 from mrmuli/feature/add-authorization-rules
Browse files Browse the repository at this point in the history
feat: Add authorization demo
  • Loading branch information
mrmuli authored Nov 17, 2022
2 parents 4be5ad9 + faf17b4 commit 72f2fa8
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 0 deletions.
13 changes: 13 additions & 0 deletions ops/blue-team-development-namespace-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: read-write-binding
namespace: development
roleRef:
kind: Role
name: blue-development-role
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: User
name: developer
apiGroup: rbac.authorization.k8s.io
11 changes: 11 additions & 0 deletions ops/blue-team-development-namespace-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: blue-development-role
namespace: development
rules:
- apiGroups:
- ""
resources: ["*"]
verbs: [ "get", "list", "watch", "create", "update", "patch", "delete" ]
13 changes: 13 additions & 0 deletions ops/blue-team-production-namespace-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: blue-developer-role-binding
namespace: production
roleRef:
kind: Role
name: blue-production-role
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: User
name: developer
apiGroup: rbac.authorization.k8s.io
11 changes: 11 additions & 0 deletions ops/blue-team-production-namespace-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: blue-developer-role
namespace: production
rules:
- apiGroups:
- ""
resources: ["*"]
verbs: [ "get", "list", "watch", "create", "update", "patch", "delete" ]
4 changes: 4 additions & 0 deletions ops/blue-team-service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: developer
7 changes: 7 additions & 0 deletions ops/developer-token.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: Secret
metadata:
name: developer-access
annotations:
kubernetes.io/service-account.name: developer
type: kubernetes.io/service-account-token
13 changes: 13 additions & 0 deletions ops/platform-team-cluster-role-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: platform-team-cluster-role-binding
namespace: development
roleRef:
kind: ClusterRole
name: platform-team-role
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: User
name: administrator
apiGroup: rbac.authorization.k8s.io
10 changes: 10 additions & 0 deletions ops/platform-team-cluster-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: platform-team-role
rules:
- apiGroups:
- ""
resources: ["*"]
verbs: [ "get", "list", "watch", "create", "update", "patch", "delete" ]
4 changes: 4 additions & 0 deletions ops/platform-team-service-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: administrator

0 comments on commit 72f2fa8

Please sign in to comment.