# This is a sample to deploy a milvus cluster using pulsar with minimum cost of resources.
apiVersion: milvus.io/v1beta1
kind: Milvus
metadata:
  name: operator-demo
  namespace: chaos-testing
  labels:
    app: milvus
spec:
  mode: standalone
  config:
    dataNode:
      memory:
        forceSyncEnable: false    
    rootCoord:
      enableActiveStandby: true
    dataCoord:
      enableActiveStandby: true
    queryCoord:
      enableActiveStandby: true
    indexCoord:
      enableActiveStandby: true
#    mixCoord:
#      enableActiveStandby: true
    quotaAndLimits:
      enable: false
    log:
      level: debug
  components:
    enableRollingUpdate: true
    imageUpdateMode: rollingUpgrade
    image: milvusdb/milvus:2.2.0-20230208-2e4d64ec
    disableMetric: false
    dataNode:
      replicas: 3
    indexNode:
      replicas: 3
    queryNode:
      replicas: 3
  dependencies:
    msgStreamType: kafka
    etcd:
      inCluster:
        deletionPolicy: Retain
        pvcDeletion: false
        values:
          replicaCount: 3
    kafka: 
      inCluster:
        deletionPolicy: Retain
        pvcDeletion: false
        values:
          replicaCount: 3
          defaultReplicationFactor: 2
          metrics:
            kafka:
              enabled: true
              serviceMonitor:
                enabled: true
            jmx:
              enabled: true      
    pulsar:
      inCluster:
        deletionPolicy: Retain
        pvcDeletion: false
        values:
          components: 
            autorecovery: false
            functions: false
            toolset: false
            pulsar_manager: false
          monitoring:
            prometheus: false
            grafana: false
            node_exporter: false
            alert_manager: false
          proxy:
            replicaCount: 1
            resources:
              requests:
                cpu: 0.01
                memory: 256Mi
            configData:
              PULSAR_MEM: >
                -Xms256m -Xmx256m
              PULSAR_GC: >
                -XX:MaxDirectMemorySize=256m
          bookkeeper:
            replicaCount: 2
            resources:
              requests:
                cpu: 0.01
                memory: 256Mi
            configData:
              PULSAR_MEM: >
                -Xms256m
                -Xmx256m
                -XX:MaxDirectMemorySize=256m
              PULSAR_GC: >
                -Dio.netty.leakDetectionLevel=disabled
                -Dio.netty.recycler.linkCapacity=1024
                -XX:+UseG1GC -XX:MaxGCPauseMillis=10
                -XX:+ParallelRefProcEnabled
                -XX:+UnlockExperimentalVMOptions
                -XX:+DoEscapeAnalysis
                -XX:ParallelGCThreads=32
                -XX:ConcGCThreads=32
                -XX:G1NewSizePercent=50
                -XX:+DisableExplicitGC
                -XX:-ResizePLAB
                -XX:+ExitOnOutOfMemoryError
                -XX:+PerfDisableSharedMem
                -XX:+PrintGCDetails
          zookeeper:
            replicaCount: 1
            resources:
              requests:
                cpu: 0.01
                memory: 256Mi
            configData:
              PULSAR_MEM: >
                -Xms256m
                -Xmx256m
              PULSAR_GC: >
                -Dcom.sun.management.jmxremote
                -Djute.maxbuffer=10485760
                -XX:+ParallelRefProcEnabled
                -XX:+UnlockExperimentalVMOptions
                -XX:+DoEscapeAnalysis -XX:+DisableExplicitGC
                -XX:+PerfDisableSharedMem
                -Dzookeeper.forceSync=no
          broker:
            replicaCount: 1
            resources:
              requests:
                cpu: 0.01
                memory: 256Mi
            configData:
              PULSAR_MEM: >
                -Xms256m
                -Xmx256m
              PULSAR_GC: >
                -XX:MaxDirectMemorySize=256m
                -Dio.netty.leakDetectionLevel=disabled
                -Dio.netty.recycler.linkCapacity=1024
                -XX:+ParallelRefProcEnabled
                -XX:+UnlockExperimentalVMOptions
                -XX:+DoEscapeAnalysis
                -XX:ParallelGCThreads=32
                -XX:ConcGCThreads=32
                -XX:G1NewSizePercent=50
                -XX:+DisableExplicitGC
                -XX:-ResizePLAB
                -XX:+ExitOnOutOfMemoryError
    storage:
      inCluster:
        deletionPolicy: Retain
        pvcDeletion: false
        values:
          mode: distributed
  