#
# Copyright (C) 2019 Vdaas.org Vald team ( kpango, kmrmt, rinx )
#
# 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: manager-backup-mysql-config
data:
  config.yaml: |
    ---
    version: v0.0.0
    server_config:
      servers:
      - name: manager-backup-mysql-rest
        host: 0.0.0.0
        port: 8080
        mode: REST
        probe_wait_time: 3s
        http:
          shutdown_duration: 5s
          handler_timeout: 5s
          idle_timeout: 2s
          read_header_timeout: 1s
          read_timeout: 1s
          write_timeout: 1s
      - name: manager-backup-mysql-grpc
        host: 0.0.0.0
        port: 8081
        mode: GRPC
        probe_wait_time: "3s"
        grpc:
          max_receive_message_size: 0
          max_send_message_size: 0
          initial_window_size: 0
          initial_conn_window_size: 0
          keepalive:
            max_idle_conn_idle: O
            max_conn_age: ""
            max_conn_age_grace: ""
            time: ""
            timeout: ""
          write_buffer_size: 0
          read_buffer_size: 0
          connection_timeout: ""
          max_header_list_size: 0
          header_table_size: 0
          interceptors: []
        restart: true
      health_check_servers:
      - name: liveness
        host: 0.0.0.0
        port: 3000
        mode: ""
        probe_wait_time: "3s"
        http:
          shutdown_duration: "5s"
          handler_timeout: ""
          idle_timeout: ""
          read_header_timeout: ""
          read_timeout: ""
          write_timeout: ""
      - name: readiness
        host: 0.0.0.0
        port: 3001
        mode: ""
        probe_wait_time: "3s"
        http:
          shutdown_duration: "5s"
          handler_timeout: ""
          idle_timeout: ""
          read_header_timeout: ""
          read_timeout: ""
          write_timeout: ""
      metrics_servers:
      - name: pprof
        host: 0.0.0.0
        port: 6060
        mode: REST
        probe_wait_time: 3s
        http:
          shutdown_duration: 5s
          handler_timeout: 5s
          idle_timeout: 2s
          read_header_timeout: 1s
          read_timeout: 1s
          write_timeout: 1s
      startup_strategy:
      - livenesss
      - pprof
      - manager-backup-mysql-grpc
      - manager-backup-mysql-rest
      - readiness
      shutdown_strategy:
      - readiness
      - manager-backup-mysql-rest
      - manager-backup-mysql-grpc
      - pprof
      - livenesss
      full_shutdown_duration: 600s
      tls:
        enabled: false
        cert: /path/to/cert
        key: /path/to/key
        ca: /path/to/ca
    mysql_config:
      db: mysql
      host: mysql.default.svc.cluster.local
      port: 3306
      user: root
      pass: _MYSQL_PASSWORD_
      name: vald
      conn_max_life_time: 30s
      max_open_conns: 100
      max_idle_conns: 100
      tls:
        enabled: false
        cert: /path/to/cert
        key: /path/to/key
        ca: /path/to/ca
      tcp:
        dns:
          cache_enabled: true
          refresh_duration: 1h
          cache_expiration: 24h
        dialer:
          timeout: 5s
          keep_alive: 5m
          dual_stack_enabled: false
        tls:
          enabled: false
          cert: /path/to/cert
          key: /path/to/key
          ca: /path/to/ca
