jenkins 6462561d02 refactor(hermes-triage-demo): ConfigMap fixture replaces Longhorn PVC
- Pipeline ensures the fixture ConfigMap and seeds unhealthy via patch-file
- Test-runner mounts the ConfigMap read-only; no storage attach involved
- New hermes-demo-repair SA + Role scoped to patching only the fixture CM
- Removes the fixture PVC (Flux prunes it)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-05 17:42:10 -03:00

86 lines
2.2 KiB
YAML

# services/hermes-triage-demo/rbac.yaml
# Two scoped grants:
# 1. Jenkins agent pods (SA jenkins/jenkins) create and observe the demo
# test-runner Job and manage the fixture ConfigMap (ensure + seed).
# 2. The Ariadne-created repair Job runs as SA hermes-demo-repair, which can
# patch only the fixture ConfigMap back to healthy.
# The Ariadne repair path needs no Job-create grant here: its
# ariadne-job-spawner ClusterRole already covers Job create/watch.
apiVersion: v1
kind: ServiceAccount
metadata:
name: hermes-demo-repair
namespace: hermes-triage-demo
labels:
app.kubernetes.io/part-of: hermes-triage-demo
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: demo-test-runner
namespace: hermes-triage-demo
labels:
app.kubernetes.io/part-of: hermes-triage-demo
rules:
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["create", "get", "list", "watch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["pods/log"]
verbs: ["get"]
- apiGroups: [""]
resources: ["configmaps"]
verbs: ["create"]
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["hermes-triage-demo-fixture"]
verbs: ["get", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: demo-test-runner-jenkins
namespace: hermes-triage-demo
labels:
app.kubernetes.io/part-of: hermes-triage-demo
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: demo-test-runner
subjects:
- kind: ServiceAccount
name: jenkins
namespace: jenkins
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: demo-repair
namespace: hermes-triage-demo
labels:
app.kubernetes.io/part-of: hermes-triage-demo
rules:
- apiGroups: [""]
resources: ["configmaps"]
resourceNames: ["hermes-triage-demo-fixture"]
verbs: ["get", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: demo-repair
namespace: hermes-triage-demo
labels:
app.kubernetes.io/part-of: hermes-triage-demo
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: demo-repair
subjects:
- kind: ServiceAccount
name: hermes-demo-repair
namespace: hermes-triage-demo