hunk.code_window:                 {{- if .GPU }}
                   nvidia.com/gpu: {{ .GPU }}
                   {{- end }}
             {{- if .Values.imagePullSecrets }}
             imagePullSecrets:
             {{ toYaml .Values.imagePullSecrets | indent 8 }}
             {{- end }}
             {{- if .nodeSelector }}
             nodeSelector:
                 {{- toYaml .nodeSelector | nindent 12 }}
  
hunk.labels: keep keep keep replace replace replace replace keep keep keep
hunk.file_path: deploy/charts/ray/templates/raycluster.yaml
hunk.type: replace
file: {{- if and (not .Values.namespacedOperator) (not .Values.clusterOnly) }}
  ---
  apiVersion: v1
  kind: ServiceAccount
  metadata:
    name: ray-operator-serviceaccount
    namespace: {{ .Values.operatorNamespace }}
  ---
  kind: ClusterRole
  apiVersion: rbac.authorization.k8s.io/v1
  metadata:
    name: ray-operator-clusterrole
  rules:
  - apiGroups: ["", "cluster.ray.io"]
    resources: ["rayclusters", "rayclusters/finalizers", "rayclusters/status", "pods", "pods/exec", "services"]
    verbs: ["get", "watch", "list", "create", "delete", "patch", "update"]
  - apiGroups: [""]
    resources: [events]
    verbs: [create]
  ---
  apiVersion: rbac.authorization.k8s.io/v1
  kind: ClusterRoleBinding
  metadata:
    name: ray-operator-clusterrolebinding
  subjects:
  - kind: ServiceAccount
    name: ray-operator-serviceaccount
    namespace: {{ .Values.operatorNamespace }}
  roleRef:
    kind: ClusterRole
    name: ray-operator-clusterrole
    apiGroup: rbac.authorization.k8s.io
  ---
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: ray-operator
    namespace: {{ .Values.operatorNamespace }}
  spec:
    replicas: 1
    selector:
      matchLabels:
        cluster.ray.io/component: operator
    template:
      metadata:
        labels:
          cluster.ray.io/component: operator
      spec:
        serviceAccountName: ray-operator-serviceaccount
        containers:
        - name: ray
          imagePullPolicy: Always
          image: {{ .Values.operatorImage }}
          command: ["ray-operator"]
          env:
          - name: AUTOSCALER_MAX_NUM_FAILURES
            value: "inf"
          resources:
            requests:
              cpu: 1
              memory: 1Gi
            limits:
              memory: 2Gi
              cpu: 1
        {{- if .Values.imagePullSecrets }}
        imagePullSecrets:
        {{ toYaml .Values.imagePullSecrets | indent 8 }}
        {{- end }}
  {{- end }}
  