apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: platforms.neuromation.io
spec:
  group: neuromation.io
  scope: Namespaced
  names:
    kind: Platform
    listKind: PlatformList
    plural: platforms
    singular: platform
    shortNames: []
  versions:
  - name: v1
    served: true
    storage: true
    additionalPrinterColumns:
    - jsonPath: .status.phase
      name: Status
      type: string
    - jsonPath: .status.retries
      name: Retries
      type: integer
    - jsonPath: .metadata.creationTimestamp
      name: Age
      type: date
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        properties:
          status:
            type: object
            properties:
              phase:
                type: string
              retries:
                type: integer
              conditions:
                type: array
                items:
                  type: object
                  required: [type, status, lastTransitionTime]
                  properties:
                    type:
                      type: string
                    status:
                      type: string
                      enum:
                      - "True"
                      - "False"
                      - "Unknown"
                    lastTransitionTime:
                      type: string
                      format: date-time
          spec:
            type: object
            required: [storages, monitoring]
            properties:
              token:
                type: string
              kubernetes:
                type: object
                properties:
                  provider:
                    type: string
                  standardStorageClassName:
                    type: string
                  tpuIPv4CIDR:
                    type: string
                  kubeletPort:
                    type: integer
                  nodeLabels:
                    type: object
                    properties:
                      job:
                        type: string
                      nodePool:
                        type: string
                      accelerator:
                        type: string
                      preemptible:
                        type: string
                  dockerConfigSecret:
                    type: object
                    properties:
                      create:
                        type: boolean
                      name:
                        type: string
              iam:
                type: object
                properties:
                  gcp:
                    type: object
                    required: [serviceAccountKeyBase64]
                    properties:
                      serviceAccountKeyBase64:
                        type: string
                  aws:
                    type: object
                    required: [region]
                    properties:
                      region:
                        type: string
                      roleArn:
                        type: string
                      s3RoleArn:
                        type: string
                oneOf:
                - required: [gcp]
                - required: [aws]
              ingressController:
                type: object
                properties:
                  enabled:
                    type: boolean
                  replicas:
                    type: integer
                    minimum: 1
                  namespaces:
                    type: array
                    items:
                      type: string
                  serviceType:
                    type: string
                    enum: [LoadBalancer, NodePort]
                  nodePorts:
                    type: object
                    required: [http, https]
                    properties:
                      http:
                        type: integer
                        minimum: 30000
                        maximum: 32767
                      https:
                        type: integer
                        minimum: 30000
                        maximum: 32767
                  hostPorts:
                    type: object
                    required: [http, https]
                    properties:
                      http:
                        type: integer
                        minimum: 0
                        maximum: 65535
                      https:
                        type: integer
                        minimum: 0
                        maximum: 65535
                  ssl:
                    type: object
                    required: [certificateData, certificateKeyData]
                    properties:
                      certificateData:
                        type: string
                      certificateKeyData:
                        type: string
                  publicIPs:
                    type: array
                    items:
                      type: string
              registry:
                type: object
                properties:
                  azure:
                    type: object
                    required: [url, username, password]
                    properties:
                      url:
                        type: string
                      username:
                        type: string
                      password:
                        type: string
                  aws:
                    type: object
                    required: [accountId, region]
                    properties:
                      accountId:
                        type: string
                      region:
                        type: string
                  gcp:
                    type: object
                    required: [project]
                    properties:
                      project:
                        type: string
                  docker:
                    type: object
                    required: [url]
                    properties:
                      url:
                        type: string
                      username:
                        type: string
                      password:
                        type: string
                  kubernetes:
                    type: object
                    required: [persistence]
                    properties:
                      persistence:
                        type: object
                        required: [storageClassName]
                        properties:
                          storageClassName:
                            type: string
                          size:
                            type: string
                oneOf:
                - required: [aws]
                - required: [gcp]
                - required: [azure]
                - required: [kubernetes]
                - required: [docker]
              storages:
                type: array
                items:
                  type: object
                  properties:
                    path:
                      type: string
                    nfs:
                      type: object
                      required: [server]
                      properties:
                        server:
                          type: string
                        path:
                          type: string
                    smb:
                      type: object
                      required: [server, shareName, username, password]
                      properties:
                        server:
                          type: string
                        shareName:
                          type: string
                        username:
                          type: string
                        password:
                          type: string
                    gcs:
                      type: object
                      required: [bucket]
                      properties:
                        bucket:
                          type: string
                    azureFile:
                      type: object
                      required: [storageAccountName, storageAccountKey, shareName]
                      properties:
                        storageAccountName:
                          type: string
                        storageAccountKey:
                          type: string
                        shareName:
                          type: string
                    kubernetes:
                      type: object
                      required: [persistence]
                      properties:
                        persistence:
                          type: object
                          required: [storageClassName]
                          properties:
                            storageClassName:
                              type: string
                            size:
                              type: string
                  oneOf:
                  - required: [nfs]
                  - required: [smb]
                  - required: [gcs]
                  - required: [azureFile]
                  - required: [kubernetes]
              blobStorage:
                type: object
                properties:
                  aws:
                    type: object
                    required: [region]
                    properties:
                      region:
                        type: string
                  gcp:
                    type: object
                    required: [project]
                    properties:
                      project:
                        type: string
                  azure:
                    type: object
                    required: [storageAccountName, storageAccountKey]
                    properties:
                      storageAccountName:
                        type: string
                      storageAccountKey:
                        type: string
                  emcEcs:
                    type: object
                    required: [accessKeyId, secretAccessKey, s3Role, endpoint, s3Endpoint]
                    properties:
                      accessKeyId:
                        type: string
                      secretAccessKey:
                        type: string
                      s3Role:
                        type: string
                      endpoint:
                        type: string
                      s3Endpoint:
                        type: string
                  openStack:
                    type: object
                    required: [username, password, region, endpoint, s3Endpoint]
                    properties:
                      username:
                        type: string
                      password:
                        type: string
                      region:
                        type: string
                      endpoint:
                        type: string
                      s3Endpoint:
                        type: string
                  minio:
                    type: object
                    required: [url, region, accessKey, secretKey]
                    properties:
                      url:
                        type: string
                      region:
                        type: string
                      accessKey:
                        type: string
                      secretKey:
                        type: string
                  kubernetes:
                    type: object
                    required: [persistence]
                    properties:
                      persistence:
                        type: object
                        required: [storageClassName]
                        properties:
                          storageClassName:
                            type: string
                          size:
                            type: string
                oneOf:
                - required: [aws]
                - required: [gcp]
                - required: [azure]
                - required: [emcEcs]
                - required: [openStack]
                - required: [minio]
                - required: [kubernetes]
              monitoring:
                type: object
                required: [logs]
                properties:
                  logs:
                    type: object
                    required: [blobStorage]
                    properties:
                      blobStorage:
                        type: object
                        required: [bucket]
                        properties:
                          region:
                            type: string
                          bucket:
                            type: string
                  metrics:
                    type: object
                    properties:
                      region:
                        type: string
                      retentionTime:
                        type: string
                      blobStorage:
                        type: object
                        required: [bucket]
                        properties:
                          bucket:
                            type: string
                      kubernetes:
                        type: object
                        required: [persistence]
                        properties:
                          persistence:
                            type: object
                            required: [storageClassName]
                            properties:
                              storageClassName:
                                type: string
                              size:
                                type: string
                    oneOf:
                    - required: [blobStorage]
                    - required: [kubernetes]
              disks:
                type: object
                properties:
                  kubernetes:
                    type: object
                    properties:
                      persistence:
                        type: object
                        required: [storageClassName]
                        properties:
                          storageClassName:
                            type: string
