apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: frontend
  name: community-book
spec:
  replicas: 2
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
  selector:
    matchLabels:
      app: community-book
  template:
    metadata:
      labels:
        app: community-book
    spec:
      containers:
      - name: server
        image: registry.cn-hongkong.aliyuncs.com/pingcap-ee/tidb-community-book:b82f5f9c477605ffbeb6c2e6a1840420adad7a0b
        livenessProbe:
          exec:
            command:
            - cat
            - /home/node/app/build/index.html
          periodSeconds: 10
          initialDelaySeconds: 5
          successThreshold: 1
          timeoutSeconds: 4
        ports:
        - containerPort: 3000
        resources:
          limits:
            cpu: "2"
            memory: 4Gi
          requests:
            cpu: "0.25"
            memory: 256Mi
      imagePullSecrets:
      - name: aliyun-hongkong-registry

---

apiVersion: v1
kind: Service
metadata:
  namespace: frontend
  name: community-book
  labels:
    app: community-book
spec:
  ports:
    - port: 80
      targetPort: 3000
      protocol: TCP
      name: http
  selector:
    app: community-book
