apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/managed-by: test-infra
    test-infra/name: tidbcloud-pov-dev
  name: tidbcloud-pov-dev
  # namespace: tiart
spec:
  selector:
    matchLabels:
      app.kubernetes.io/managed-by: test-infra
      test-infra/name: tidbcloud-pov-dev
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app.kubernetes.io/managed-by: test-infra
        test-infra/name: tidbcloud-pov-dev
    spec:
      containers:
        - args:
            - --config=/etc/config/svc-conf.yaml
            - --secret=/etc/config/secrets
          command:
            - /apps/tidbcloud-pov
          image: 946646677266.dkr.ecr.us-west-2.amazonaws.com/tidbcloud-pov/service:2025112717
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 10
            httpGet:
              path: /ping
              port: 80
              scheme: HTTP
            initialDelaySeconds: 1
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 10
          name: main
          ports:
            - containerPort: 80
              protocol: TCP
          readinessProbe:
            failureThreshold: 10
            httpGet:
              path: /ping
              port: 80
              scheme: HTTP
            initialDelaySeconds: 1
            periodSeconds: 10
            successThreshold: 1
            timeoutSeconds: 1
          resources:
            limits:
              cpu: "8"
              memory: 32Gi
            requests:
              cpu: "4"
              memory: 8Gi
          volumeMounts:
            - mountPath: /etc/config
              name: tidbcloud-pov-svc-conf
              readOnly: true
            - mountPath: /etc/config/secrets
              name: tidbcloud-pov-svc-secret
              readOnly: true
      dnsPolicy: ClusterFirst
      imagePullSecrets:
        - name: dockerhubkey
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      nodeSelector:
        nodegroup: 4xlarge
      tolerations:
        - effect: NoSchedule
          key: nodegroup
          operator: Equal
          value: 4xlarge
        - effect: NoSchedule
          key: dedicated
          operator: Equal
          value: test-infra
      terminationGracePeriodSeconds: 30
      volumes:
        - name: tidbcloud-pov-svc-conf
          configMap:
            defaultMode: 420
            name: tidbcloud-pov-config-dev
        - name: tidbcloud-pov-svc-secret
          secret:
            secretName: tidbcloud-pov-secret-dev

---
apiVersion: v1
kind: Service
metadata:
  name: tidbcloud-pov-dev
spec:
  ports:
    - port: 80
      protocol: TCP
      targetPort: 80
  selector:
    test-infra/name: tidbcloud-pov-dev
  sessionAffinity: None
  type: ClusterIP


