apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: daskclusters.kubernetes.dask.org
spec:
  scope: Namespaced
  group: kubernetes.dask.org
  names:
    kind: DaskCluster
    plural: daskclusters
    singular: daskcluster
    shortNames:
      - daskcluster
      - dsk
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            status:
              type: object
            spec:
              type: object
              required:
              - scheduler
              - worker
              properties:
                scheduler:
                  $ref: 'python://dask_kubernetes/operator/customresources/templates.yaml#/definitions/dask.k8s.api.v1.DaskScheduler'
                worker:
                  $ref: 'python://dask_kubernetes/operator/customresources/templates.yaml#/definitions/dask.k8s.api.v1.DaskWorker' 
                  
      subresources:
        scale:
          specReplicasPath: .spec.worker.replicas
          statusReplicasPath: .status.replicas