apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: egpus.egpucontroller.tencent.com
  # for more information on the below annotation, please see
  # https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/2337-k8s.io-group-protection/README.md
  annotations:
    "api-approved.kubernetes.io": "unapproved, experimental-only; please get an approval from Kubernetes API reviewers if you're trying to develop a CRD in the *.k8s.io or *.kubernetes.io groups"
spec:
  group: egpucontroller.tencent.com
  versions:
    - name: v1alpha1
      served: true
      storage: true
      additionalPrinterColumns:
        - name: Node
          type: string
          jsonPath: .spec.nodeName
        - name: GPU
          type: string
          jsonPath: .spec.gpu
        - name: QGPUMemory
          type: string
          jsonPath: .spec.resources.capacity.QGPUMemory
        - name: QGPUCore
          type: string
          jsonPath: .spec.resources.capacity.QGPUCore
        - name: Age
          type: date
          jsonPath: .metadata.creationTimestamp
      schema:
        # schema used for validation
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                nodeName:
                  type: string
                gpu:
                  items:
                    format: string
                    type: string
                  type: array
                resources:
                  type: object
                  properties:
                    capacity:
                      type: object
                      properties:
                        QGPUMemory:
                          type: string
                        QGPUCore:
                          type: string
            status:
              type: object
              properties:
                availableReplicas:
                  type: integer
      # subresources for the custom resource
      subresources:
        # enables the status subresource
        status: {}

  names:
    kind: EGPU
    plural: egpus
  scope: Namespaced