---
apiVersion: v1
kind: Service
metadata:
  name: org
  namespace: edoc2
  labels:
    app: org
spec:
  ports:
  - name: org-6310
    port: 6310
    targetPort: 6310
    protocol: TCP
  - name: org-16310
    port: 16310
    targetPort: 16310
    protocol: TCP
  selector:
    app: org
  type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment 
metadata:
  name: org
  namespace: edoc2
  labels:
    app: org
    k8s-app: org
spec:
  replicas: 3
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: org
  template:
    metadata:
      labels:
        app: org
    spec:
      hostname: org
      terminationGracePeriodSeconds: 60
      containers:
      - name: org-container
        image: registry.edoc2.com:5000/edoc2v5/org:km-v6.2.0.0
        imagePullPolicy: IfNotPresent
        envFrom:
        - configMapRef:
            name: mid-envfile
        - configMapRef:
            name: ecm-envfile
        - configMapRef:
            name: inbiz-envfile
        - configMapRef:
            name: km-envfile
        ports:
        - name: org-6310
          containerPort: 6310
        - name: org-16310
          containerPort: 16310
        resources:
          requests:
            cpu: 400m
            memory: 600Mi
          limits:
            cpu: 900m
            memory: 1200Mi
        securityContext:
          capabilities:
            add: ["SYS_PTRACE"]
        livenessProbe:
          exec:
            command: ["curl","-L","-k","-i","http://localhost:6310/api/values|grep '200 OK'"]
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 3         # 检测时间间隔
          failureThreshold: 5       # 检测失败5次表示未就绪     
          successThreshold: 1       # 检查成功为2次表示就绪
      restartPolicy: Always
      nodeSelector:
        node.drive.nodelabels: InDrive