# RBAC for Argo workflow archive — grants controller and server access
# to the PostgreSQL archive secret and MinIO credentials.
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: argo-archive-secrets
  namespace: foxhunt
  labels:
    app.kubernetes.io/part-of: argo-workflows
rules:
- apiGroups: [""]
  resources: ["secrets"]
  resourceNames: ["argo-postgres-config", "minio-credentials"]
  verbs: ["get"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: argo-archive-secrets
  namespace: foxhunt
  labels:
    app.kubernetes.io/part-of: argo-workflows
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: argo-archive-secrets
subjects:
- kind: ServiceAccount
  name: argo-workflows-workflow-controller
  namespace: foxhunt
- kind: ServiceAccount
  name: argo-workflows-server
  namespace: foxhunt
