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