apiVersion: apps/v1
kind: Deployment
metadata:
  name: tcms-jobs
  namespace: test-infra
  labels:
    app: tcms-jobs
spec:
  selector:
    matchLabels:
      app: tcms-jobs
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: tcms-jobs
      annotations:
        app.kubernetes.io/managed-by: test-infra
    spec:
      tolerations:
      - effect: NoSchedule
        key: dedicated
        operator: Equal
        value: test-infra
      nodeSelector:
        resourcepool: default
      containers:
        - name: main
          image: hub.pingcap.net/qa/tcms:638d8f88
          command: ["/apps/jobs"]
          args:
          - --config=/etc/config/config.yaml
          - --secret=/etc/secret-config
          resources:
            requests:
              cpu: 100m
              memory: 200Mi
          volumeMounts:
          - name: timezone
            mountPath: /etc/localtime
          - name: config
            mountPath: /etc/config
            readOnly: true
          - name: secret-config
            mountPath: /etc/secret-config
            readOnly: true
      volumes:
        - name: timezone
          hostPath:
            path: /usr/share/zoneinfo/Asia/Shanghai
        - name: config
          configMap:
            name: tcms-config
        - name: secret-config
          secret:
            secretName: tcms-secret-config
      restartPolicy: Always
