apiVersion: apps/v1
kind: Deployment
metadata:
  name: inbiz-initdatabase
  namespace: edoc2
  labels:
    app: inbiz-initdatabase
    k8s-app: inbiz-initdatabase
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: inbiz-initdatabase
  template:
    metadata:
      labels:
        app: inbiz-initdatabase
    spec:
      hostname: inbiz-initdatabase
      terminationGracePeriodSeconds: 60
      containers:
        - name: inbiz-initdatabase
          image: registry.edoc2.com:5000/edoc2v5/inbiz-initdatabase:inbiz-v6.5.2.14
          imagePullPolicy: IfNotPresent
          envFrom:
            - configMapRef:
                name: mid-envfile
            - configMapRef:
                name: inbiz-envfile
          securityContext:
            capabilities:
              add: ["SYS_PTRACE"]
          ports:
            - name: init-http
              containerPort: 5008
          # livenessProbe:
          #   exec:
          #     command:
          #       [
          #         "curl",
          #         "-L",
          #         "-k",
          #         "-i",
          #         "http://inbiz-initdatabase:5008/api/values|grep '200 OK'",
          #       ]
          #   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-initdatabase
  namespace: edoc2
  labels:
    app: inbiz-initdatabase
spec:
  ports:
    - name: init-http
      port: 5008
      targetPort: 5008
      protocol: TCP
  selector:
    app: inbiz-initdatabase
  type: ClusterIP
