### 简易 tidb 集群, 各个组件默认配置
---
generateName: testbed-
reclaimPolicy:
  gcStrategy:
    onFailure:
      artifact:
        monitor: true
        log: true
      reserveEnv:
        durationOnWorkingHour: 3h
        scaleIn: false
        scaleDown: true
      notification:
        feishu: https://open.feishu.cn/open-apis/bot/v2/hook/4e2fb51b-2e09-433b-91c4-1e5a71eb8f3f
items:
  - name: tc-upstream # 资源对象项名称
    type: TIDB_CLUSTER # 资源对象类型
    spec:
      version: "master" # 全局 version 字段，结合 baseImage 使用
      # 如想在集群创建出来后立即执行一些操作, 可以配置 postStart 字段
      postStart:
        # 当集群创建后立即执行初始化 SQL 语句, 只有当 sql 执行成功, 集群才处于就绪状态.
        sql: |
          use test;
          create table t(id int)
      pd:
        replicas: 1
        # baseImage: hub.pingcap.net/qa/pd # baseImage 设置后 image 字段失效，此时 image = <baseImage>:<version>，用到升级时必须设置 baseImage
        baseImage: hub.pingcap.net/qa/pd
        # version: "v5.0.2" # 局部覆盖 spec.version 字段

        # more refer to: https://github.com/tikv/pd/blob/master/conf/config.toml
        # config is string type and toml format, I prefer uses https://www.convertsimple.com/convert-yaml-to-toml/ to transfer yaml to toml
        config: |
          [log]
          level = "info"
      tidb:
        replicas: 1
        baseImage: hub.pingcap.net/qa/tidb
        config: |
          [log]
          # Log level: debug, info, warn, error, fatal.
          level = "info"
      tikv:
        replicas: 1
        baseImage: hub.pingcap.net/qa/tikv
        # more refer to: https://github.com/tikv/tikv/blob/master/etc/config-template.toml
        config: |
          ## Log levels: trace, debug, info, warning, error, critical.
          ## Note that `debug` and `trace` are only available in development builds.
          log-level = "info"
          [storage]
          reserve-space = "0MB"
      ngMonitoring:
        # ngmonitoring 从 v5.3.1 才开始支持, 对于老版本的 tidb 集群, 可以通过 create: false 取消部署 ngm
        create: true
        # 可以单独设置 ngMonitoring 的 version, 如未设置, 则会使用 tidb cluster spec.version 的值
        # version: master
        baseImage: hub.pingcap.net/qa/ng-monitoring
