dch-webhooks: Add role for Jenkins to deploy
Jenkins needs to be able to patch the Deployment to trigger a restart after it builds a new container image for _dch-webhooks_. Note that this manifest must be applied on its own **without Kustomize**. Kustomize seems to think the `dch-webhooks` in `resourceNames` refers to the ConfigMap it manages and "helpfully" renames it with the name suffix hash. It's _not_ the ConfigMap, though, but there's not really any way to tell it this.
This commit is contained in:
28
dch-webhooks/jenkins.yaml
Normal file
28
dch-webhooks/jenkins.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: jenkins.dch-webhooks
|
||||
rules:
|
||||
- apiGroups:
|
||||
- apps
|
||||
resources:
|
||||
- deployments
|
||||
resourceNames:
|
||||
- dch-webhooks
|
||||
verbs:
|
||||
- get
|
||||
- patch
|
||||
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: jenkins.dch-webhooks
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: jenkins.dch-webhooks
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: default
|
||||
namespace: jenkins-jobs
|
||||
Reference in New Issue
Block a user