apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: istiomulticlusters.deckhouse.io
  labels:
    heritage: deckhouse
    module: istio
spec:
  group: deckhouse.io
  scope: Cluster
  names:
    plural: istiomulticlusters
    singular: istiomulticluster
    kind: IstioMulticluster
  preserveUnknownFields: false
  versions:
    - name: v1alpha1
      served: true
      storage: true
      subresources:
        status: {}
      schema:
        openAPIV3Schema:
          type: object
          description: |
            CR for setting remote cluster as trusted one.
          required:
          - spec
          properties:
            spec:
              type: object
              required:
              - metadataEndpoint
              properties:
                enableIngressGateway:
                  type: boolean
                  default: true
                  description: |
                    Should Istio use ingressgateways to access remote Pods? If remote Pods are accessible directly from our cluster ("flat" network), it is efficient not to use extra hop.
                metadataEndpoint:
                  type: string
                  description: |
                    HTTPS endpoint with remote cluster metadata.
                  pattern: '^(https|file)://[0-9a-zA-Z._/-]+$'
                  example: 'https://istio.k8s.example.com/metadata/'
            status:
              type: object
              properties:
                metadataCache:
                  type: object
                  properties:
                    public:
                      type: object
                      properties:
                        rootCA:
                          type: string
                        authnKeyPub:
                          type: string
                        clusterUUID:
                          type: string
                    publicLastFetchTimestamp:
                      type: string
                      format: date-time
                    private:
                      type: object
                      properties:
                        apiHost:
                          type: string
                        networkName:
                          type: string
                        ingressGateways:
                          type: array
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                              port:
                                type: integer
                    privateLastFetchTimestamp:
                      format: date-time
                      type: string
