apiVersion: apps/v1
kind: Deployment
metadata:
  name: inbiz-businesslog
  namespace: edoc2
  labels:
    app: inbiz-businesslog
    k8s-app: inbiz-businesslog
spec:
  replicas: 3
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: inbiz-businesslog
  template:
    metadata:
      labels:
        app: inbiz-businesslog
    spec:
      hostname: inbiz-businesslog
      terminationGracePeriodSeconds: 60
      containers:
        - image: registry.edoc2.com:5000/edoc2v5/inbiz-businesslog:edrms-v6.5.0.1-rc12-arm
          imagePullPolicy: IfNotPresent
          name: inbiz-businesslog
          envFrom:
            - configMapRef:
                name: mid-envfile
            - configMapRef:
                name: inbiz-envfile
          securityContext:
            capabilities:
              add: ["SYS_PTRACE"]
          ports:
            - name: log-http
              containerPort: 5010
            - name: log-grpc
              containerPort: 15010
          livenessProbe:
            httpGet:
              path: /api/values
              port: log-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:
  labels:
    app: inbiz-businesslog
  name: inbiz-businesslog
  namespace: edoc2
spec:
  ports:
    - name: log-http
      port: 5010
      protocol: TCP
      targetPort: 5010
    - name: log-grpc
      port: 15010
      protocol: TCP
      targetPort: 15010
  selector:
    app: inbiz-businesslog
  #sessionAffinity: ClientIP
  #sessionAffinityConfig:
  #  clientIP:
  #    timeoutSeconds: 5
  type: ClusterIP
