### 多 zone 的 tidb cluster 声明
### RMS k8s 环境我们将节点在逻辑上划分成 3 个 zone: zone1, zone2, zone3, zone 之间的网络延迟需要借助 chaos-mesh 等工具进行模拟
---
generateName: testbed-
items:
  - name: tc
    type: TIDB_CLUSTER
    spec:
      # 如果使用一个具体的版本, 例如 v5.0.1 而不是 nightly, master 等, 通过设置 IfNotPresent 可以加速创建速度
      imagePullPolicy: IfNotPresent
      version: v5.0.1
      pd:
        replicas: 1
        baseImage: hub.pingcap.net/qa/pd
        # 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: |
          [replication]
          location-labels = [ "zone", "host" ]
      tidb:
        replicas: 3
        baseImage: hub.pingcap.net/qa/tidb
        # details please refer to: https://github.com/pingcap/tidb/blob/master/config/config.toml.example
        config: |
          [log]
          # Log level: debug, info, warn, error, fatal.
          level = "info"
        requests:
          cpu: 4000m
          memory: 8Gi
        limits:
          cpu: 4000m
          memory: 8Gi
        # caution: topologySpreadConstraints only supports on k8s provider environment, it may don't work well on dbaas or some others
        # more info refers on: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
        topologySpreadConstraints:
          # means the tikv node is evenly distributed in three zone: zone1, zone2, zone3 in our test
          - topologyKey: zone
        # I suggest don't add the hostname topologyKey since the scale of our testing cluster is small
        # - topologyKey: kubernetes.io/hostname
      tikv:
        replicas: 6
        # maxReplicas 字段用于预占资源保证 case 扩容/升级成功, 扩容场景填最大副本数，纯升级场景可填 maxReplicas = replicas. tidb|pd 等配置方式相同
        # 注意填写 maxReplicas 字段后每个 pod 的重启操作会额外增加 30~60s 的延迟
        maxReplicas: 7
        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 = 0
        requests:
          cpu: 4000m
          memory: 8Gi
        limits:
          cpu: 4000m
          memory: 8Gi
        # caution: topologySpreadConstraints only supports on k8s provider environment, it may don't work well on dbaas or some others
        # more info refers on: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/
        topologySpreadConstraints:
          # means the tikv node is evenly distributed in three zone: zone1, zone2, zone3 in our test
          - topologyKey: zone
          # I suggest don't add the hostname topologyKey since the scale of our testing cluster is small
          # - topologyKey: kubernetes.io/hostname
