#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements.  See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License.  You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: submarines.submarine.apache.org
  labels:
    app.kubernetes.io/name: submarine-operator
    app.kubernetes.io/version: "0.8.0-SNAPSHOT"
    app.kubernetes.io/component: submarine-operator
    app.kubernetes.io/managed-by: Helm
spec:
  group: submarine.apache.org
  names:
    kind: Submarine
    listKind: SubmarineList
    plural: submarines
    singular: submarine
    shortNames:
    - sm
    categories:
    - all
  scope: Namespaced
  versions:
  - name: v1alpha1
    schema:
      openAPIV3Schema:
        type: object
        required: ["spec"]
        properties:
          spec:
            type: object
            required:
              - version
            properties:
              version:
                description: submarine docker image version
                type: string
              server:
                type: object
                properties:
                  image:
                    description: Use this to overwrite the image when development
                    type: string
                  replicas:
                    type: integer
                    minimum: 1
              database:
                type: object
                properties:
                  image:
                    description: Use this to overwrite the image when development
                    type: string
                  storageSize:
                    type: string
                  mysqlRootPasswordSecret:
                    type: string
              tensorboard:
                type: object
                properties:
                  enabled:
                    type: boolean
                  storageSize:
                    type: string
              mlflow:
                type: object
                properties:
                  enabled:
                    type: boolean
                  storageSize:
                    type: string
              minio:
                type: object
                properties:
                  enabled:
                    type: boolean
                  storageSize:
                    type: string
          status:
            type: object
            properties:
              availableServerReplicas:
                type: integer
              availableDatabaseReplicas:
                type: integer
              submarineState:
                type: object
                properties:
                  state:
                    type: string
                  errorMessage:
                    type: string
    served: true
    storage: true
    subresources:
      status: {}
