Skip to content

Commit ef4849d

Browse files
authored
Merge pull request #156 from kcp-dev/fix-permissions-agent-event
Fix permissions agent event
2 parents 48299f5 + 7db0d9e commit ef4849d

File tree

2 files changed

+37
-1
lines changed

2 files changed

+37
-1
lines changed

charts/api-syncagent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: api-syncagent
33
description: A Kubernetes agent to synchronize APIs and their objects between Kubernetes clusters and kcp.
44

55
# version information
6-
version: 0.3.0
6+
version: 0.3.1
77
appVersion: "v0.3.0"
88

99
# optional metadata

charts/api-syncagent/templates/rbac.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,42 @@ subjects:
3636
- kind: ServiceAccount
3737
name: '{{ template "name" . }}'
3838

39+
---
40+
# A dedicated role and binding just to allow the agent to publish events on PublishedResources,
41+
# which are cluster-scoped and so use default (by default) as their events namespace. Even though
42+
# it might be technically possible to store events for cluster-scoped objects in a different
43+
# namespace, `kubectl describe` will always use "default" when describing such objects, even if you
44+
# ran it with `kubectl -n ... describe`.
45+
apiVersion: rbac.authorization.k8s.io/v1
46+
kind: RoleBinding
47+
metadata:
48+
name: '{{ template "name" . }}:{{ .Release.Namespace }}:events'
49+
namespace: default
50+
roleRef:
51+
apiGroup: rbac.authorization.k8s.io
52+
kind: Role
53+
name: '{{ template "name" . }}:{{ .Release.Namespace }}:events'
54+
subjects:
55+
- kind: ServiceAccount
56+
name: '{{ template "name" . }}'
57+
namespace: '{{ .Release.Namespace }}'
58+
59+
---
60+
apiVersion: rbac.authorization.k8s.io/v1
61+
kind: Role
62+
metadata:
63+
name: '{{ template "name" . }}:{{ .Release.Namespace }}:events'
64+
namespace: default
65+
rules:
66+
- apiGroups:
67+
- ""
68+
resources:
69+
- events
70+
verbs:
71+
- create
72+
- update
73+
- patch
74+
3975
---
4076
apiVersion: rbac.authorization.k8s.io/v1
4177
kind: ClusterRole

0 commit comments

Comments
 (0)