apiVersion: apps/v1
kind: Deployment
metadata:
  name: covid-shanghai-deployment
spec:
  replicas: 2
  selector:
    matchLabels:
      component: covid-shanghai-server
  template:
    metadata:
      labels:
        component: covid-shanghai-server
    spec:
      imagePullSecrets:
        - name: huawei-swr-image-pull-secret
      containers:
        - image: swr.cn-north-4.myhuaweicloud.com/opensourceway/common/covidshanghai:974f90d7ad0c0d1a95826fdd5d71f3a5c547ba1c
          imagePullPolicy: Always
          name: covid-shanghai-server
          livenessProbe:
            httpGet:
              path: "/shanghai-covid"
              port: 8080
            initialDelaySeconds: 3
            periodSeconds: 5
          readinessProbe:
            httpGet:
              path: "/shanghai-covid"
              port: 8080
            initialDelaySeconds: 10
            failureThreshold: 1
            periodSeconds: 5
            timeoutSeconds: 10
          resources:
            requests:
              cpu: 1000m
              memory: 1000Mi
            limits:
              cpu: 4000m
              memory: 4000Mi
          ports:
            - containerPort: 8080
              name: http
              protocol: TCP
          # if we don't need to deploy on root domain, use args: --server.baseUrlPath shanghai-covid
          args: ["--server.baseUrlPath", "shanghai-covid"]
          env:
            - name: STREAMLIT_SERVER_PORT
              value: "8080"
      serviceAccountName: covid-shanghai
