apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cp9-dedicated-o11y-agent-control-server
rules:
  - apiGroups: ["agent.observability.pingcap.com"]
    resources: ["*"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  - apiGroups: ["ec2.aws.crossplane.io"]
    resources: ["vpcendpoints"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  - apiGroups: ["eks.aws.crossplane.io"]
    resources: ["nodegroups"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  - apiGroups: ["container.gcp.crossplane.io"]
    resources: ["clusters", "nodepools"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  - apiGroups: ["eks.aws.crossplane.io"]
    resources: ["clusters"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["aws.crossplane.io"]
    resources: ["providerconfigs"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["dedicated.regionalserver.tidbcloud.com"]
    resources: ["vpcs"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["cloud.pingcap.com"]
    resources: ["clusters"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["eks.aws.upbound.io"]
    resources: ["nodegroups"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["ec2.aws.upbound.io"]
    resources: ["vpcendpoints"]
    verbs: ["get", "list", "watch"]
  - apiGroups: ["autoscaling.aws.crossplane.io"]
    resources: ["autoscalinggroups"]
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["get", "list", "watch", "create", "update", "patch"]
  - apiGroups: ["coordination.k8s.io"]
    resources: ["leases"]
    verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: cp9-dedicated-o11y-agent-control-server
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cp9-dedicated-o11y-agent-control-server
subjects:
  - kind: User
    name: cp9:dedicated:o11y-agent-control-server
    apiGroup: rbac.authorization.k8s.io
