apiVersion: v1
kind: ServiceAccount
metadata:
  name: cluster-agent
  namespace: cluster-agent-e2e
  labels:
    app.kubernetes.io/name: cluster-agent
    app.kubernetes.io/part-of: cluster-agent
---
# cluster-agent uses controller-runtime client.Client which needs access to
# K8s API for CRD operations. In E2E we grant broad read access so the service
# starts cleanly without requiring tidb-operator CRDs to be installed.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: cluster-agent-e2e
  labels:
    app.kubernetes.io/name: cluster-agent
    app.kubernetes.io/part-of: cluster-agent
subjects:
  - kind: ServiceAccount
    name: cluster-agent
    namespace: cluster-agent-e2e
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
