apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: vfunctionservers.vfunction.com
  labels:
    name: vfunction
    app.kubernetes.io/name: vfunction
    app.kubernetes.io/instance: vfunction-server
    app.kubernetes.io/managed-by: operator
spec:
  group: vfunction.com
  names:
    kind: VfunctionServer
    listKind: VfunctionServerList
    plural: vfunctionservers
    singular: vfunctionserver
  scope: Namespaced
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          description: VfunctionServer is the Schema for the vfunctionservers API
          properties:
            apiVersion:
              description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
              type: string
            kind:
              description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
              type: string
            metadata:
              type: object
            spec:
              description: VfunctionServerSpec defines the desired state of VfunctionServer
              properties:
                admin:
                  properties:
                    email:
                      type: string
                    name:
                      type: string
                    password:
                      type: string
                  required:
                    - email
                    - name
                    - password
                  type: object
                host:
                  type: string
                org_name:
                  type: string
                mysql:
                  properties:
                    external_mysql_ip:
                      type: string
                    external_mysql_port:
                      type: string
                    external_mysql_user:
                      type: string
                    external_mysql_password:
                      type: string
                    restore_db_from_last_dump:
                      type: string
                  type: object
                nginx:
                  properties:
                    force_http:
                      type: string
                  type: object
                measurements:
                  properties:
                    auto_scaling:
                      type: string
                    min_number_of_services:
                      type: string
                    max_number_of_services:
                      type: string
                    max_pod_memory_capacity:
                      type: string
                    S3:
                      properties:
                        bucket:
                          type: string
                        key:
                          type: string
                        secret:
                          type: string
                        region:
                          type: string
                      required:
                        - bucket
                        - key
                        - secret
                      type: object
                  type: object
                smtp:
                  properties:
                    identity:
                      type: string
                    password:
                      type: string
                    url:
                      type: string
                    user:
                      type: string
                  required:
                    - identity
                    - password
                    - url
                    - user
                  type: object
                authentication:
                  properties:
                    authority:
                      type: string
                    client_id:
                      type: string
                    jwks_url:
                      type: string
                    issuer:
                      type: string
                    ca_root_crt:
                      type: string
                  required:
                    - authority
                    - client_id
                    - jwks_url
                    - issuer
                  type: object
                tls:
                  properties:
                    use_letsencrypt:
                      type: string
                    crt:
                      type: string
                    key:
                      type: string
                  required:
                    - crt
                    - key
                  type: object
                backup:
                  properties:
                    mysql:
                      properties:
                        S3:
                          properties:
                            bucket:
                              type: string
                            key:
                              type: string
                            secret:
                              type: string
                            region:
                              type: string
                          required:
                            - bucket
                            - key
                            - secret
                          type: object
                      type: object
                  type: object
                version:
                  type: string
                build:
                  type: string
                upgrade:
                  type: string
                retry_upgrade:
                  type: string
              required:
                - admin
                - host
                - org_name
              type: object
            status:
              description: VfunctionServerStatus defines the observed state of VfunctionServer
              properties:
                state:
                  type: string
                installed:
                  type: string
                currentVersion:
                  type: string
                mysqlImage:
                  type: string
                storageImage:
                  type: string
                nginxImage:
                  type: string
                vfapiIdpImage:
                  type: string
                vfapiMeasurementsImage:
                  type: string
                vfapiOrganizationsImage:
                  type: string
                vfapiUsersImage:
                  type: string
                identifier:
                  type: string
                lastWorkingVersion:
                  type: string
                lastFailedVersion:
                  type: string
                offline:
                  type: boolean
                lastDailyReportDate:
                  type: string
              type: object
          type: object
