apiVersion: v1
kind: ServiceAccount
metadata:
  name: kagent
  namespace: kagent
  labels:
    app: kagent
    managed-by: vapora

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: kagent
  labels:
    app: kagent
    managed-by: vapora
rules:
  - apiGroups: [""]
    resources: ["pods", "pods/log", "services"]
    verbs: ["get", "list", "watch"]
  - apiGroups: [""]
    resources: ["configmaps"]
    verbs: ["get", "list"]
  - apiGroups: ["batch"]
    resources: ["jobs"]
    verbs: ["get", "list", "watch", "create", "delete"]
  - apiGroups: [""]
    resources: ["events"]
    verbs: ["create", "patch"]

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: kagent
  labels:
    app: kagent
    managed-by: vapora
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: kagent
subjects:
  - kind: ServiceAccount
    name: kagent
    namespace: kagent

---
apiVersion: v1
kind: ResourceQuota
metadata:
  name: kagent-quota
  namespace: kagent
spec:
  hard:
    requests.cpu: "10"
    requests.memory: "20Gi"
    limits.cpu: "20"
    limits.memory: "40Gi"
    pods: "100"
