#
# 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: meta-cassandra-config
data:
  config.yaml: |
    ---
    version: v0.0.0
    server_config:
      servers:
      - name: meta-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: meta-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
      - meta-grpc
      - meta-rest
      - readiness
      shutdown_strategy:
      - readiness
      - meta-rest
      - meta-grpc
      - pprof
      - livenesss
      full_shutdown_duration: 600s
      tls:
        enabled: false
        cert: /path/to/cert
        key: /path/to/key
        ca: /path/to/ca
    cassandra_config:
      hosts:
        - cassandra-0.cassandra.default.svc.cluster.local
        - cassandra-1.cassandra.default.svc.cluster.local
        - cassandra-2.cassandra.default.svc.cluster.local
      cql_version: 3.0.0
      proto_version: 0
      timeout: 600ms
      connect_timeout: 600ms
      port: 9042
      keyspace: vald
      num_conns: 2
      consistency:  quorum
      username: ""
      password: ""
      retry_policy:
        num_retries: 3
        min_duration: 1s
        max_duration: 30s
      reconnection_policy:
        max_retries: 3
        initial_interval: 1m
      socket_keepalive: 0s
      max_prepared_stmts: 1000
      max_routing_key_info: 1000
      page_size: 5000
      tls:
        enabled: false
        cert: /path/to/cert
        key: /path/to/key
        ca: /path/to/ca
      enable_host_verification: false
      default_timestamp: true
      reconnect_interval: 1m
      max_wait_schema_agreement: 1m
      ignore_peer_addr: false
      disable_initial_host_lookup: false
      disable_node_status_events: false
      disable_topology_events: false
      disable_skip_metadata: false
      default_idempotence: false
      write_coalesce_wait_time: 200ms
      kv_table: kv
      vk_table: vk
