Skip to content

Commit 0c80b22

Browse files
committed
fix(argo/argo-events): update roles and rolebindings appropriately
The roles and rolebindings for argo workflows need to be with the namespace that they are running in. Not in the argo namespace. They were then hand included in the argo-events namespace so move to using the consistent configs from the upstream project.
1 parent 5c7332e commit 0c80b22

File tree

10 files changed

+135
-292
lines changed

10 files changed

+135
-292
lines changed

components/argo-events/argo-role.yaml

Lines changed: 0 additions & 148 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: apps/v1
2+
kind: RoleBinding
3+
metadata:
4+
name: argo-server-binding
5+
subjects:
6+
- kind: ServiceAccount
7+
name: argo-server
8+
namespace: argo

components/argo-events/argo-server-role.yaml

Lines changed: 0 additions & 88 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: apps/v1
2+
kind: RoleBinding
3+
metadata:
4+
name: argo-binding
5+
subjects:
6+
- kind: ServiceAccount
7+
name: argo
8+
namespace: argo

components/argo-events/default-role.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.

components/argo-events/kustomization.yaml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ resources:
77
- https://github.com/argoproj/argo-events/releases/download/v1.9.7/install.yaml
88
- https://github.com/argoproj/argo-events/releases/download/v1.9.7/install-validating-webhook.yaml
99

10-
## configure rbac to integrate with argo-workflow
11-
# - default-role.yaml
12-
- argo-server-role.yaml
13-
- argo-role.yaml
10+
# grant the argo-workflows the ability to run workflows in this namespace
11+
- https://github.com/argoproj/argo-workflows/manifests/namespace-install/argo-server-rbac?ref=v3.5.10
12+
- https://github.com/argoproj/argo-workflows/manifests/namespace-install/workflow-controller-rbac?ref=v3.5.10
1413

1514
## configure webhook Sensor and associated role
1615
- sensor-workflow-role.yaml
@@ -23,3 +22,14 @@ resources:
2322

2423
## copy openstack/cinder-netapp-config to argo-events/netapp-config
2524
- secret-netapp.yaml
25+
26+
patches:
27+
- target:
28+
kind: RoleBinding
29+
name: argo-binding
30+
path: controller-rb.yaml
31+
32+
- target:
33+
kind: RoleBinding
34+
name: argo-server-binding
35+
path: argo-server-rb.yaml
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This is a role and rolebinding to provide the argo-server with permissions
2+
# it needs to run in its own namespace.
3+
# - to read the configmap for its configuration
4+
# - read the SSO secret
5+
# - create and read other secrets for auth tokens
6+
# - events to provide prometheus metrics
7+
---
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
kind: Role
10+
metadata:
11+
name: argo-server-runtime
12+
rules:
13+
- apiGroups:
14+
- ""
15+
resources:
16+
- configmaps
17+
verbs:
18+
- get
19+
- watch
20+
resourceNames:
21+
- workflow-controller-configmap
22+
- apiGroups:
23+
- ""
24+
resources:
25+
- secrets
26+
verbs:
27+
- get
28+
- create
29+
---
30+
apiVersion: rbac.authorization.k8s.io/v1
31+
kind: RoleBinding
32+
metadata:
33+
name: argo-server-runtime
34+
roleRef:
35+
apiGroup: rbac.authorization.k8s.io
36+
kind: Role
37+
name: argo-server-runtime
38+
subjects:
39+
- kind: ServiceAccount
40+
name: argo-server

components/argo/kustomization.yaml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44

55
resources:
6-
# the same as using namespace-install.yaml but easier to follow what the
7-
# actual pieces we are using are
6+
# We are doing upstream's namespace-install.yaml but since we
7+
# want the actual workflows to run in a different namespace
8+
# the roles are created there
89
- https://github.com/argoproj/argo-workflows/manifests/base?ref=v3.5.10
9-
- https://github.com/argoproj/argo-workflows/manifests/namespace-install/argo-server-rbac?ref=v3.5.10
10-
- https://github.com/argoproj/argo-workflows/manifests/namespace-install/workflow-controller-rbac?ref=v3.5.10
10+
# give the workflow controller access it needs
11+
- workflow-controller-runtime.yaml
12+
# give the argo-server access it needs
13+
- argo-server-runtime.yaml
1114

1215
# ingress for workflows.${DNS_ZONE} to the argo server for the UI
1316
- ingress.yaml
@@ -41,15 +44,6 @@ patches:
4144
name: workflow-controller
4245
path: ./workflow-controller-deployment.yaml
4346

44-
# see the patch for details on the change
45-
- target:
46-
group: rbac.authorization.k8s.io
47-
version: v1
48-
kind: Role
49-
# this is the role that the workflow-controller runs with
50-
name: argo-role
51-
path: ./workflow-controller-role.yaml
52-
5347
# apply our configuration changes to the configmap
5448
configMapGenerator:
5549
- name: workflow-controller-configmap

0 commit comments

Comments
 (0)