apiVersion: api/v1
kind: Plan
name: endless-mem-zto-analyze
#type: ONE_SHOT
schedule: "@daily"
tags: []
testbed:
  generateName: endless-mem-zto-
  reclaimPolicy:
    lease: 24h
    gcStrategy:
      onFailure:
        artifact:
          monitor: true
          log: true
        reserveEnv:
          durationOnWorkingHour: '3h'
        notification:
          feishu: https://open.feishu.cn/open-apis/bot/v2/hook/df1958ba-c846-49f6-b0fe-caf2732441d5
      onSuccess:
        notification:
          feishu: https://open.feishu.cn/open-apis/bot/v2/hook/df1958ba-c846-49f6-b0fe-caf2732441d5
        artifact:
          monitor: true
          log: true
  items:
  - name: tc
    type: TIDB_CLUSTER
    spec:
      timezone: Asia/Shanghai
      pd:
        replicas: 3
        requests:
          cpu: 4000m
          memory: 8Gi
        limits:
          cpu: 4000m
          memory: 8Gi
        service:
          type: NodePort
        config: |
          [dashboard]
          internal-proxy = true
        baseImage: '{{meta.parameters.pd_base_image}}'
        version: '{{meta.parameters.pd_component_version}}'
      tikv:
        replicas: 3
        requests:
          cpu: 16000m
          memory: 48Gi
        limits:
          cpu: 16000m
          memory: 48Gi
        baseImage: '{{meta.parameters.tikv_base_image}}'
        version: '{{meta.parameters.tikv_component_version}}'
      tidb:
        replicas: 2
        requests:
          cpu: 8000m
          memory: 16Gi
        limits:
          cpu: 8000m
          memory: 16Gi
        baseImage: '{{meta.parameters.tidb_base_image}}'
        version: '{{meta.parameters.tidb_component_version}}'
      monitor:
        initializer:
          baseImage: hub-new.pingcap.net/qa/tidb-monitor-initializer
          version: '{{meta.parameters.base_image_version}}'
      version: '{{meta.parameters.base_image_version}}'
  - name: olapworkload1
    type: WORKLOAD_NODE
    spec:
      container:
        name: zto1
        image: hub.pingcap.net/qa/hchwang-zto:latest
        command:
        - tail
        - "-f"
        - "/dev/null"
  - name: olapworkload2
    type: WORKLOAD_NODE
    spec:
      container:
        name: zto2
        image: hub.pingcap.net/qa/hchwang-zto:latest
        command:
        - tail
        - "-f"
        - "/dev/null"
  - name: olapworkload3
    type: WORKLOAD_NODE
    spec:
      container:
        name: zto3
        image: hub.pingcap.net/qa/hchwang-zto:latest
        command:
        - tail
        - "-f"
        - "/dev/null"
  - name: olapworkload4
    type: WORKLOAD_NODE
    spec:
      container:
        name: zto4
        image: hub.pingcap.net/qa/hchwang-zto:latest
        command:
        - tail
        - "-f"
        - "/dev/null"
steps:
- name: analyze-mem-quota
  caseName: analyze-mem-quota
  arguments:
  - name: tc
    value: "{{testbed.tc}}"
  - name: olapworkload1
    value: '{{testbed.olapworkload1}}'
  - name: olapworkload2
    value: '{{testbed.olapworkload2}}'
  - name: olapworkload3
    value: '{{testbed.olapworkload3}}'
  - name: olapworkload4
    value: '{{testbed.olapworkload4}}'
failFast: true
