apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: spark-analytics-driver
  labels:
    app.kubernetes.io/name: spark-analytics
    app.kubernetes.io/part-of: nowchess
rules:
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["create", "get", "list", "watch", "delete", "patch"]
  - apiGroups: [""]
    resources: ["services"]
    verbs: ["create", "get", "delete"]
  - apiGroups: [""]
    resources: ["configmaps"]
    verbs: ["create", "get", "list", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: spark-analytics-driver
  labels:
    app.kubernetes.io/name: spark-analytics
    app.kubernetes.io/part-of: nowchess
subjects:
  - kind: ServiceAccount
    name: spark-analytics
roleRef:
  kind: Role
  name: spark-analytics-driver
  apiGroup: rbac.authorization.k8s.io
