apiVersion: api/v1
kind: Plan
name: rawkv-ccb-app-router-ha-test-api-v2
resourcePool: scenario
#type: ONE_SHOT
schedule: "@daily"
tags: ["rawkv"]
testbed:
  generateName: rawkv-app-router-ha-v610-v2ttl
  resourcePool: brie
  reclaimPolicy:
    gcStrategy:
      onFailure:
        artifact:
          monitor: true
          log: true
        reserveEnv:
          durationOnWorkingHour: '1h'
        notification:
          feishu: https://open.feishu.cn/open-apis/bot/v2/hook/d7749c41-5a70-4eea-ba29-238b34391d01
  items:
    - name: tiup
      type: WORKLOAD_NODE 
      spec:
        artifact:
          artifactPaths:
            - /usr/src/automate/
        container:
          name: node
          image: hub-new.pingcap.net/qa/rawkvtiup:latest
          imagePullPolicy: Always
          resources:
            requests:
              memory: 16Gi
              cpu: 4000m
          securityContext:
            capabilities:
              add: ["SYS_ADMIN", "SYS_PTRACE", "NET_ADMIN"]
    - name: pd
      type: WORKLOAD_NODE
      spec:
          replicas: 3
          artifact:
            artifactPaths:         # NOTE: 测试结束后会打包的目录, 每个目录一个 tarball 传到 minio
            - /tiup/deploy/pd-2579/log
          container:
              name: node
              image: hub.pingcap.net/qa/base-image
              imagePullPolicy: Always
              storageClassName: "fast-disks"
              resources:
                requests:
                    cpu: 4000m
                    memory: 16Gi
                    storage: 100Gi
              securityContext:
                  capabilities:
                      add: ["SYS_ADMIN", "SYS_PTRACE", "NET_ADMIN"]
    - name: tikv
      type: WORKLOAD_NODE
      spec:
          replicas: 9
          artifact:
            artifactPaths:         # NOTE: 测试结束后会打包的目录, 每个目录一个 tarball 传到 minio
            - /tiup/deploy/tikv-20360/log
          container:
              name: node
              image: hub.pingcap.net/qa/base-image
              imagePullPolicy: Always
              storageClassName: "fast-disks"
              resources:
                requests:
                    cpu: 10000m
                    memory: 16Gi
                    storage: 200Gi
              securityContext:
                  capabilities:
                      add: ["SYS_ADMIN", "SYS_PTRACE", "NET_ADMIN"]
    - name: tidb
      type: WORKLOAD_NODE
      spec:
          replicas: 1
          artifact:
            artifactPaths:         # NOTE: 测试结束后会打包的目录, 每个目录一个 tarball 传到 minio
            - /tiup/deploy/tidb-4000/log
          container:
              name: node
              image: hub.pingcap.net/qa/base-image
              imagePullPolicy: Always
              # storageClassName: "fast-disks"
              resources:
                requests:
                    cpu: 4000m
                    memory: 16Gi
                    # storage: 200Gi
              securityContext:
                  capabilities:
                      add: ["SYS_ADMIN", "SYS_PTRACE", "NET_ADMIN"]
    - name: workload0
      type: WORKLOAD_NODE
      spec:
        replicas: 4
        artifact:
            artifactPaths:
                - /usr/src/rawkvworkload/log/
        container:
          name: workload
          image: hub-new.pingcap.net/qa/rawkvworkload:api-v2
          labels:
            workload-app: ccbload
          command:
            - tail
            - "-f"
            - "/dev/null"
          resources:
            requests:
              memory: 16Gi
              cpu: 4000m
    - name: ccbloadimport
      type: WORKLOAD_NODE
      spec:
        artifact:
            artifactPaths:
                - /usr/src/rawkvworkload/log/
        container:
          name: workload
          image: hub-new.pingcap.net/qa/rawkvworkload:api-v2
          command:
            - tail
            - "-f"
            - "/dev/null"
          resources:
            requests:
              memory: 16Gi
              cpu: 4000m
    - name: clientmonitor
      type: WORKLOAD_NODE
      spec:
        artifact:
            artifactPaths:
                - /prometheus
        container:
          name: workload
          image: prom/prometheus:v2.8.1
          resources:
            requests:
              memory: 32Gi
              cpu: 4000m
steps:
- name: ccb-scenario-005
  caseName: RawKV_AppRouter_Scene_005
  caseImage: hub.pingcap.net/endless/endless:pr-669
  arguments:
  - name: tiup
    value: "{{testbed.tiup}}"
  - name: workload0
    value: "{{testbed.workload0}}"
  - name: ccbloadimport
    value: "{{testbed.ccbloadimport}}"
  - name: clientmonitor
    value: "{{testbed.clientmonitor}}"