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