apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: daskworkergroups.kubernetes.dask.org
spec:
  scope: Namespaced
  group: kubernetes.dask.org
  names:
    kind: DaskWorkerGroup
    plural: daskworkergroups
    singular: daskworkergroup
    shortNames:
      - daskworkers
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            status:
              type: object
            spec:
              type: object
              required:
              - cluster
              - worker
              properties:
                cluster:
                  type: string
                  description: Name of the cluster to associate this worker group with
                worker:
                  $ref: 'python://dask_kubernetes/operator/customresources/templates.yaml#/definitions/dask.k8s.api.v1.DaskWorker' 
      subresources:
        scale:
          specReplicasPath: .spec.worker.replicas
          statusReplicasPath: .status.replicas
