apiVersion: apps/v1
kind: Deployment
metadata:
  name: inbiz-model
  namespace: edoc2
  labels:
    app: inbiz-model
    k8s-app: inbiz-model
spec:
  replicas: 3
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: inbiz-model
  template:
    metadata:
      labels:
        app: inbiz-model
    spec:
      hostname: inbiz-model
      terminationGracePeriodSeconds: 60
      containers:
        - name: inbiz-model
          image: registry.edoc2.com:5000/edoc2v5/inbiz-model:inbiz-v6.5.2.8
          envFrom:
            - configMapRef:
                name: mid-envfile
            - configMapRef:
                name: inbiz-envfile
          securityContext:
            capabilities:
              add: ["SYS_PTRACE"]
          ports:
            - name: model-http
              containerPort: 5011
            - name: model-grpc
              containerPort: 15011
          livenessProbe:
            httpGet:
              path: /api/values
              port: model-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-model
  namespace: edoc2
  labels:
    app: inbiz-model
spec:
  ports:
    - name: model-http
      port: 5011
      targetPort: 5011
      protocol: TCP
    - name: model-grpc
      port: 15011
      targetPort: 15011
      protocol: TCP
  selector:
    app: inbiz-model
  type: ClusterIP
