apiVersion: apps/v1
kind: Deployment
metadata:
  name: inbiz-backend
  namespace: edoc2
  labels:
    app: inbiz-backend
    k8s-app: inbiz-backend
spec:
  replicas: 3
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: inbiz-backend
  template:
    metadata:
      labels:
        app: inbiz-backend
    spec:
      hostname: inbiz-backend
      terminationGracePeriodSeconds: 60
      containers:
        - image: registry.edoc2.com:5000/edoc2v5/inbiz-backend:inbiz-v6.7.0.0
          imagePullPolicy: IfNotPresent
          name: inbiz-backend
          envFrom:
            - configMapRef:
                name: mid-envfile
            - configMapRef:
                name: inbiz-envfile
          securityContext:
            capabilities:
              add: ["SYS_PTRACE"]
          ports:
            - name: backend-http
              containerPort: 5006
            - name: backend-grpc
              containerPort: 15006
          livenessProbe:
            httpGet:
              path: /api/values
              port: backend-http
            initialDelaySeconds: 60
            periodSeconds: 10
            timeoutSeconds: 3 # 检测时间间隔
            failureThreshold: 5 # 检测失败5次表示未就绪
            successThreshold: 1 # 检查成功为2次表示就绪
      restartPolicy: Always
      nodeSelector:
        node.drive.nodelabels: InDrive
---
apiVersion: v1
kind: Service
metadata:
  name: inbiz-backend
  namespace: edoc2
  labels:
    app: inbiz-backend
spec:
  ports:
    - name: backend-http
      port: 5006
      targetPort: 5006
      protocol: TCP
    - name: backend-grpc
      port: 15006
      targetPort: 15006
      protocol: TCP
  selector:
    app: inbiz-backend
  type: ClusterIP
