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

---

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