apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/managed-by: test-infra
    test-infra/name: tidbcloud-pov-web-prod
  name: tidbcloud-pov-web-prod
spec:
  selector:
    matchLabels:
      app.kubernetes.io/managed-by: test-infra
      test-infra/name: tidbcloud-pov-web-prod
  replicas: 1
  revisionHistoryLimit: 5
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
  template:
    metadata:
      labels:
        app.kubernetes.io/managed-by: test-infra
        test-infra/name: tidbcloud-pov-web-prod
    spec:
      containers:
        - name: web
          image: hub.pingcap.net/qa/tidbcloud-pov-website:prod
          imagePullPolicy: Always
          env:
            - name: APP_ENV
              value: production
          ports:
            - containerPort: 3000
              protocol: TCP
          readinessProbe:
            httpGet:
              path: /
              port: 3000
            initialDelaySeconds: 0
            periodSeconds: 10
            failureThreshold: 6
          livenessProbe:
            httpGet:
              path: /
              port: 3000
            initialDelaySeconds: 30
            periodSeconds: 20
            failureThreshold: 3
          startupProbe:
            httpGet:
              path: /
              port: 3000
            failureThreshold: 30
            periodSeconds: 5
          resources:
            requests:
              cpu: 1
              memory: 2Gi
            limits:
              cpu: "2"
              memory: 4Gi
      imagePullSecrets:
        - name: dockerhubkey
      restartPolicy: Always

---
apiVersion: v1
kind: Service
metadata:
  name: tidbcloud-pov-web-prod
spec:
  selector:
    test-infra/name: tidbcloud-pov-web-prod
  ports:
    - port: 80
      targetPort: 3000
      protocol: TCP
      nodePort: 31333
  type: NodePort
