# 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: v1
kind: ConfigMap
metadata:
  name: nuvolaris-milvus
  namespace: nuvolaris
data:
  default.yaml: |+
    # Copyright (C) 2019-2021 Zilliz. 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.

    etcd:
      rootPath: milvus
      auth:
        enabled: true
        userName: root 
        password: {{milvus_etcd_root_password}}
      endpoints:
      {% for idx in etcd_range -%}
      - {{etcd_container}}-{{idx}}.nuvolaris-etcd-headless.nuvolaris.svc.cluster.local:2379
      {% endfor %}


    metastore:
      type: etcd 
         
    minio:
      address: nuvolaris-minio
      port: 9000
      accessKeyID: {{milvus_s3_username}}
      secretAccessKey: {{milvus_s3_password}}
      useSSL: false
      bucketName: vectors
      rootPath: files
      useIAM: false
      useVirtualHost: false
    
    mq:
      type: pulsar
    
    messageQueue: pulsar
    
    pulsar:
      address: nuvolaris-milvus-pulsarv3-proxy
      port: 6650
      maxMessageSize: 104857600    
    
    mq:
      type: rocksmq    
    
    messageQueue: rocksmq

    rootCoord:
      address: localhost
      port: 53100
      enableActiveStandby: false  # Enable rootcoord active-standby
      maxDatabaseNum: {{milvus_max_database_num}}
    
    proxy:
      port: 19530
      internalPort: 19529
      maxRoleNum: {{milvus_max_role_num}}
      maxUserNum: {{milvus_max_user_num}}
    
    queryCoord:
      address: localhost
      port: 19531
    
      enableActiveStandby: false  # Enable querycoord active-standby
    
    queryNode:
      port: 21123
      enableDisk: true # Enable querynode load disk index, and search on disk index
    
    indexCoord:
      address: localhost
      port: 31000
      enableActiveStandby: false  # Enable indexcoord active-standby
    
    indexNode:
      port: 21121
      enableDisk: true # Enable index node build disk vector index
    
    dataCoord:
      address: localhost
      port: 13333
      enableActiveStandby: false  # Enable datacoord active-standby
    
    dataNode:
      port: 21124
    
    log:
      level: info
      file:
        rootPath: ""
        maxSize: 300
        maxAge: 10
        maxBackups: 20
      format: text
  user.yaml: |-
    #    For example enable rest http for milvus proxy
    #    proxy:
    #      http:
    #        enabled: true
    #      maxUserNum: 100
    #      maxRoleNum: 10
    ##  Enable tlsMode and set the tls cert and key
    #  tls:
    #    serverPemPath: /etc/milvus/certs/tls.crt
    #    serverKeyPath: /etc/milvus/certs/tls.key
    #   common:
    #     security:
    #       tlsMode: 1
    # Enable User Authentication
    common:
      security:
        authorizationEnabled: true
        defaultRootPassword: {{milvus_root_password}}