apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app.kubernetes.io/managed-by: test-infra
    test-infra/name: tidbcloud-pov-web-dev
  name: tidbcloud-pov-web-dev
spec:
  selector:
    matchLabels:
      app.kubernetes.io/managed-by: test-infra
      test-infra/name: tidbcloud-pov-web-dev
  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-dev
    spec:
      containers:
        - name: web
          image: hub.pingcap.net/qa/tidbcloud-pov-website:dev
          imagePullPolicy: Always
          env:
            - name: APP_ENV
              value: development
          ports:
            - containerPort: 3000
              protocol: TCP
          readinessProbe:
            httpGet:
              path: /
              port: 3000
            initialDelaySeconds: 5
            periodSeconds: 10
          livenessProbe:
            httpGet:
              path: /
              port: 3000
            initialDelaySeconds: 10
            periodSeconds: 20
          resources:
            requests:
              cpu: "250m"
              memory: 256Mi
            limits:
              cpu: "1"
              memory: 1Gi
      imagePullSecrets:
        - name: dockerhubkey
      restartPolicy: Always

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

