25f860652c
Per CEO directive on PRI-324: the actual cluster namespace for
shared E2E runs is `headlamp-dev`. References to `privilegedescalation-dev`
in the workflow, scripts, and runner RBAC were stale and prevented the
runner SA from acquiring permissions where they were granted on-cluster.
Also fixes the malformed `e2e-ci-runner-polaris` Role added in 0cd9eb0
which incorrectly carried `subjects:` and `roleRef:` (RoleBinding-only
fields) — kept rules-only on the Role and the binding in the matching
RoleBinding below.
Applies QA nits from PR #123: collapsed MISSING_ROLE/MISSING_ROLEBINDING
into a single MISSING flag in the pre-flight step. Dropped the
non-standard `--quiet` flag on get calls (already redirected to /dev/null).
75 lines
2.3 KiB
YAML
75 lines
2.3 KiB
YAML
---
|
|
# RBAC for the GitHub Actions CI runner to manage the E2E Headlamp instance.
|
|
# CI-only test fixture — NOT for production use.
|
|
#
|
|
# Grants the ARC runner service account permissions in the headlamp-dev
|
|
# namespace to deploy and tear down a dedicated Headlamp instance via Helm,
|
|
# and in the polaris namespace to apply the Polaris dashboard proxy RBAC
|
|
# before the E2E pre-flight check.
|
|
#
|
|
# Plugin is loaded via ConfigMap volume mount — no custom Docker images.
|
|
#
|
|
# Prerequisites:
|
|
# kubectl apply -f deployment/e2e-ci-runner-rbac.yaml
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: Role
|
|
metadata:
|
|
name: e2e-ci-runner
|
|
namespace: headlamp-dev
|
|
rules:
|
|
# Helm needs to manage these resources for the Headlamp chart
|
|
- apiGroups: ["apps"]
|
|
resources: ["deployments"]
|
|
verbs: ["get", "list", "create", "update", "patch", "delete", "watch"]
|
|
- apiGroups: [""]
|
|
resources: ["services", "serviceaccounts", "configmaps", "secrets"]
|
|
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
|
|
- apiGroups: [""]
|
|
resources: ["pods"]
|
|
verbs: ["get", "list", "watch"]
|
|
# Token creation for E2E test auth
|
|
- apiGroups: [""]
|
|
resources: ["serviceaccounts/token"]
|
|
verbs: ["create"]
|
|
---
|
|
# RBAC for CI runner to apply Polaris dashboard RBAC in the polaris namespace.
|
|
# The E2E workflow runs `kubectl apply -f deployment/polaris-rbac.yaml` before
|
|
# the pre-flight check to make the workflow self-sufficient.
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: Role
|
|
metadata:
|
|
name: e2e-ci-runner-polaris
|
|
namespace: polaris
|
|
rules:
|
|
- apiGroups: ["rbac.authorization.k8s.io"]
|
|
resources: ["roles", "rolebindings"]
|
|
verbs: ["get", "list", "create", "update", "patch", "delete"]
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: RoleBinding
|
|
metadata:
|
|
name: e2e-ci-runner-polaris-binding
|
|
namespace: polaris
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: runners-privilegedescalation-gha-rs-no-permission
|
|
namespace: arc-runners
|
|
roleRef:
|
|
kind: Role
|
|
name: e2e-ci-runner-polaris
|
|
apiGroup: rbac.authorization.k8s.io
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: RoleBinding
|
|
metadata:
|
|
name: e2e-ci-runner-binding
|
|
namespace: headlamp-dev
|
|
subjects:
|
|
- kind: ServiceAccount
|
|
name: runners-privilegedescalation-gha-rs-no-permission
|
|
namespace: arc-runners
|
|
roleRef:
|
|
kind: Role
|
|
name: e2e-ci-runner
|
|
apiGroup: rbac.authorization.k8s.io
|