# Copyright 2016 Google Inc. All rights reserved.
#
# Licensed 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.

info:
  title: Kubeflow Permanent Storage
  author: Google, Inc.
  description: |
    Creates permanent storage for Kubeflow deployment

required:
- zone

properties:
  zone:
    type: string
  disks:
    type: array
    items:
      type: object
      required:
      - usage
      properties:
        sizeGb:
          type: integer
          default: 200
        diskType:
          type: string
          default: pd-standard
          enum:
          - pd-standard
          - pd-ssd
        usage:
          type: string
          description: what is the disk used for
          enum:
          - metadata-store
          - artifact-store

  cloudsql:
    type: object
    default:
      properties:
    properties:
      databaseVersion:
        type: string
        description: MYSQL_5_7 or MYSQL_5_6
        default: MYSQL_5_6
      dataDiskSizeGb:
        type: integer
        minimum: 10
        maximum: 1000
        default: 10
      dataDiskType:
        type: string
        decription: PD_SSD or PD_HDD
        default: PD_SSD
      backupStartTime:
        type: string
        description: HH:MM in 24 hour format
        default: 00:00
      tier:
        type: string
        description: https://cloud.google.com/sql/pricing#2nd-gen-pricing
        default: db-n1-highmem-4
      region:
        type: string
        description: i.e. us-central1
        default: us-central1
      zone:
        type: string
        description: i.e. us-central1-a
        default: us-central1-a
      authorizedNetworks:
        type: array
        description: An array of allowed CIDR blocks
        items:
          type: string

  databaseFlags:
    type: array
    description: An array of https://cloud.google.com/sql/docs/mysql/flags
    items:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
        value:
          type:
            - integer
            - string

  dbUser:
    type: object
    properties:
      name:
        type: string
        default: root
      host:
        type: string
        default: '%'

  database:
    type: object
    required:
      - name
    properties:
      name:
        type: string
      charset:
        type: string
        description: https://dev.mysql.com/doc/refman/5.7/en/charset.html
        default: utf8
