---
#
# Copyright (C) 2019-2021 vdaas.org vald team <vald@vdaas.org>
#
# 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
#
#    https://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: vald-discoverer-config
  labels:
    app.kubernetes.io/name: vald
    helm.sh/chart: vald-v1.0.2
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/instance: RELEASE-NAME
    app.kubernetes.io/version: v1.0.2
    app.kubernetes.io/component: discoverer
data:
  config.yaml: |
    ---
    version: v0.0.0
    time_zone: UTC
    logging:
      format: raw
      level: debug
      logger: glg
    server_config:
      servers:
        - name: grpc
          host: 0.0.0.0
          port: 8081
          grpc:
            bidirectional_stream_concurrency: 20
            connection_timeout: ""
            header_table_size: 0
            initial_conn_window_size: 0
            initial_window_size: 0
            interceptors:
            - RecoverInterceptor
            keepalive:
              max_conn_age: ""
              max_conn_age_grace: ""
              max_conn_idle: ""
              time: ""
              timeout: ""
            max_header_list_size: 0
            max_receive_message_size: 0
            max_send_message_size: 0
            read_buffer_size: 0
            write_buffer_size: 0
          mode: GRPC
          probe_wait_time: 3s
          restart: true
      health_check_servers:
        - name: liveness
          host: 0.0.0.0
          port: 3000
          http:
            handler_timeout: ""
            idle_timeout: ""
            read_header_timeout: ""
            read_timeout: ""
            shutdown_duration: 5s
            write_timeout: ""
          mode: ""
          probe_wait_time: 3s
        - name: readiness
          host: 0.0.0.0
          port: 3001
          http:
            handler_timeout: ""
            idle_timeout: ""
            read_header_timeout: ""
            read_timeout: ""
            shutdown_duration: 0s
            write_timeout: ""
          mode: ""
          probe_wait_time: 3s
      metrics_servers:
        - name: pprof
          host: 0.0.0.0
          port: 6060
          http:
            handler_timeout: 5s
            idle_timeout: 2s
            read_header_timeout: 1s
            read_timeout: 1s
            shutdown_duration: 5s
            write_timeout: 1s
          mode: REST
          probe_wait_time: 3s
      startup_strategy:
        - liveness
        - pprof
        - grpc
        - readiness
      full_shutdown_duration: 600s
      tls:
        ca: /path/to/ca
        cert: /path/to/cert
        enabled: false
        insecure_skip_verify: false
        key: /path/to/key
    observability:
      enabled: false
      collector:
        duration: 5s
        metrics:
          enable_cgo: true
          enable_goroutine: true
          enable_memory: true
          enable_version_info: true
          version_info_labels:
          - vald_version
          - server_name
          - git_commit
          - build_time
          - go_version
          - go_os
          - go_arch
          - ngt_version
      trace:
        enabled: false
        sampling_rate: 1
      prometheus:
        enabled: false
        endpoint: /metrics
        namespace: vald
      jaeger:
        enabled: false
        collector_endpoint: ""
        agent_endpoint: "jaeger-agent.default.svc.cluster.local:6831"
        username: ""
        password: ""
        service_name: "vald-discoverer"
        buffer_max_count: 10
      stackdriver:
        project_id: ""
        client:
          api_key: ""
          audiences: []
          authentication_enabled: true
          credentials_file: ""
          credentials_json: ""
          endpoint: ""
          quota_project: ""
          request_reason: ""
          scopes: []
          telemetry_enabled: true
          user_agent: ""
        exporter:
          bundle_count_threshold: 0
          bundle_delay_threshold: "0"
          location: ""
          metric_prefix: vald.vdaas.org
          monitoring_enabled: false
          number_of_workers: 1
          reporting_interval: 1m
          skip_cmd: false
          timeout: 5s
          trace_spans_buffer_max_bytes: 0
          tracing_enabled: false
        profiler:
          enabled: false
          service: "vald-discoverer"
          service_version: ""
          debug_logging: false
          mutex_profiling: true
          cpu_profiling: true
          alloc_profiling: true
          heap_profiling: true
          goroutine_profiling: true
          alloc_force_gc: false
          api_addr: ""
          instance: ""
          zone: ""
    discoverer:
      discovery_duration: 3s
      name: ""
      namespace: _MY_POD_NAMESPACE_
      tcp:
        dialer:
          dual_stack_enabled: false
          keep_alive: 10m
          timeout: 30s
        dns:
          cache_enabled: true
          cache_expiration: 24h
          refresh_duration: 5m
        tls:
          ca: /path/to/ca
          cert: /path/to/cert
          enabled: false
          insecure_skip_verify: false
          key: /path/to/key
