apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: hainan-oa-biz
    app.kubernetes.io/name: hainan-biz
    app.kubernetes.io/version: v1
    version: v1
  annotations:
    kubesphere.io/description: '政务OA后端服务接口'
  name: hainan-oa-biz-v1
  namespace: hainan-prod
spec:
  progressDeadlineSeconds: 600
  replicas: 2
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: hainan-oa-biz
      app.kubernetes.io/name: hainan-biz
      app.kubernetes.io/version: v1
      version: v1
  template:
    metadata:
      labels:
        app: hainan-oa-biz
        app.kubernetes.io/name: hainan-biz
        app.kubernetes.io/version: v1
        version: v1
      annotations:
        kubesphere.io/containerSecrets: '{"hainan-oa-biz":"harbor"}'
    spec:
      containers:
        - image: $REGISTRY/$DOCKERHUB_NAMESPACE/$APP_NAME:$TAG_NAME
          imagePullPolicy: Always
          name: hainan-oa-biz
          ports:
            - containerPort: 8080
              name: tcp-8080
              protocol: TCP
          env:
            - name: JAVA_OPTS
              valueFrom:
                configMapKeyRef:
                  name: jvm
                  key: JAVA_OPTS
            - name: YZ_MODE
              value: prod
          resources:
            limits:
              cpu: 1000m
              memory: 2000Mi
            requests:
              cpu: 10m
              memory: 10Mi
          livenessProbe:
            httpGet:
              path: /actuator/health/liveness
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 120
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /actuator/health/readiness
              port: 8080
              scheme: HTTP
            initialDelaySeconds: 80
            timeoutSeconds: 1
            periodSeconds: 10
            successThreshold: 1
            failureThreshold: 3
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      imagePullSecrets:
        - name: harbor