Skip to content

Commit

Permalink
separate SAs for controller/webhook deployment to allow for different…
Browse files Browse the repository at this point in the history
… permission sets
  • Loading branch information
gabemontero committed Nov 2, 2020
1 parent 8d12cd6 commit e3df317
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 2 deletions.
18 changes: 17 additions & 1 deletion config/200-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,27 @@ metadata:
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-triggers
rules:
- apiGroups: ["policy"]
resources: ["podsecuritypolicies"]
resourceNames: ["tekton-triggers"]
verbs: ["use"]

---

kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: tekton-triggers-admin-webhook
namespace: tekton-pipelines
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-triggers
rules:
- apiGroups: ["policy"]
resources: ["podsecuritypolicies"]
resourceNames: ["tekton-triggers"]
verbs: ["use"]
- apiGroups: [""]
resources: ["secrets"]
resources: ["configmaps", "services", "events"]
verbs: ["get", "list", "create", "update", "delete", "patch", "watch"]
11 changes: 11 additions & 0 deletions config/200-serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,14 @@ metadata:
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-triggers

---

apiVersion: v1
kind: ServiceAccount
metadata:
name: tekton-triggers-webhook
namespace: tekton-pipelines
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-triggers
18 changes: 18 additions & 0 deletions config/201-clusterrolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,21 @@ roleRef:
kind: ClusterRole
name: tekton-triggers-admin
apiGroup: rbac.authorization.k8s.io

---

apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: tekton-triggers-webhook-admin
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-triggers
subjects:
- kind: ServiceAccount
name: tekton-triggers-webhook
namespace: tekton-pipelines
roleRef:
kind: ClusterRole
name: tekton-triggers-admin
apiGroup: rbac.authorization.k8s.io
19 changes: 19 additions & 0 deletions config/201-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,22 @@ roleRef:
kind: Role
name: tekton-triggers-admin
apiGroup: rbac.authorization.k8s.io

---

apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: tekton-triggers-webhook-admin
namespace: tekton-pipelines
labels:
app.kubernetes.io/instance: default
app.kubernetes.io/part-of: tekton-triggers
subjects:
- kind: ServiceAccount
name: tekton-triggers-webhook
namespace: tekton-pipelines
roleRef:
kind: Role
name: tekton-triggers-admin-webhook
apiGroup: rbac.authorization.k8s.io
2 changes: 1 addition & 1 deletion config/webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
# version value replaced with inputs.params.versionTag in triggers/tekton/publish.yaml
version: "devel"
spec:
serviceAccountName: tekton-triggers-controller
serviceAccountName: tekton-triggers-webhook
containers:
- name: webhook
# This is the Go import path for the binary that is containerized
Expand Down

0 comments on commit e3df317

Please sign in to comment.