apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: egpucs.egpuccontroller.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: egpuccontroller.tencent.com
  versions:
    - name: v1alpha1
      served: true
      storage: true
      additionalPrinterColumns:
        - name: PodName
          type: string
          jsonPath: .spec.podName
        - name: ContainerName
          type: string
          jsonPath: .spec.container.containerName
        - name: QGPUMemory
          type: string
          jsonPath: .spec.container.resources.requests.QGPUMemory
        - name: QGPUCore
          type: string
          jsonPath: .spec.container.resources.requests.QGPUCore
        - name: Age
          type: date
          jsonPath: .metadata.creationTimestamp
      schema:
        # schema used for validation
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                podName:
                  type: string
                nameSpace:
                  type: string
                container:
                  type: object
                  properties:
                    containerName:
                      type: string
                    resources:
                      type: object
                      properties:
                        requests:
                          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: EGPUC
    plural: egpucs
  scope: Namespaced