--- # ClusterRole for workflow execution - allows creating namespaces and deploying resources apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: workflow-executor rules: # Namespace management - apiGroups: [""] resources: ["namespaces"] verbs: ["create", "get", "list", "patch", "update", "delete"] # Apps - Deployments, DaemonSets, StatefulSets, ReplicaSets - apiGroups: ["apps"] resources: ["deployments", "daemonsets", "statefulsets", "replicasets"] verbs: ["create", "get", "list", "watch", "patch", "update", "delete"] # Core resources - Services, ConfigMaps, Secrets, ReplicationControllers - apiGroups: [""] resources: ["services", "configmaps", "secrets", "replicationcontrollers"] verbs: ["create", "get", "list", "watch", "patch", "update", "delete"] # Batch - Jobs and CronJobs - apiGroups: ["batch"] resources: ["jobs", "cronjobs"] verbs: ["create", "get", "list", "watch", "patch", "update", "delete"] # Autoscaling - HorizontalPodAutoscalers - apiGroups: ["autoscaling"] resources: ["horizontalpodautoscalers"] verbs: ["get", "list", "watch"] # Resource Quotas and Limit Ranges - apiGroups: [""] resources: ["resourcequotas", "limitranges"] verbs: ["create", "get", "list", "patch", "update", "delete"] # Network Policies - apiGroups: ["networking.k8s.io"] resources: ["networkpolicies"] verbs: ["create", "get", "list", "patch", "update", "delete"] # Pods for verification and workflow execution - apiGroups: [""] resources: ["pods", "pods/log"] verbs: ["get", "list", "watch", "patch", "update"] # ArgoCD Applications (CRDs) - apiGroups: ["argoproj.io"] resources: ["applications"] verbs: ["create", "get", "list", "patch", "update", "delete"] # Argo Workflows - for creating and managing workflows - apiGroups: ["argoproj.io"] resources: ["workflows"] verbs: ["create", "get", "list", "patch", "update", "delete"] --- # Bind the workflow-executor role to the service accounts in argo-workflows namespace apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: workflow-executor-binding roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: workflow-executor subjects: - kind: ServiceAccount name: default namespace: argo-workflows - kind: ServiceAccount name: argo-workflows namespace: argo-workflows - kind: ServiceAccount name: argo-workflows-server namespace: argo-workflows - kind: ServiceAccount name: backstage-argo-workflows namespace: argo-workflows