operator_role:
apiVersion: v1
kind: ServiceAccount
metadata:
  name: ray-operator-serviceaccount
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: ray-operator-role
rules:
- apiGroups: ["", "cluster.ray.io"]
  resources: ["rayclusters", "pods", "pods/exec"]
  verbs: ["get", "watch", "list", "create", "delete", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: ray-operator-rolebinding
subjects:
- kind: ServiceAccount
  name: ray-operator-serviceaccount
roleRef:
  kind: Role
  name: ray-operator-role
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: Pod
metadata:
  name: ray-operator-pod
spec:
  serviceAccountName: ray-operator-serviceaccount
  containers:
  - name: ray
    imagePullPolicy: Always
    image: rayproject/ray:nightly
    command: ["ray-operator"]
    env:
    - name: RAY_OPERATOR_POD_NAMESPACE
      valueFrom:
        fieldRef:
          fieldPath: metadata.namespace
    resources:
      requests:
        cpu: 1
        memory: 1Gi
      limits:
        memory: 2Gi
