---
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: dev.registry.edoc2.com/edoc2v5/org:20240612114203_d2a1d249536081b8
        imagePullPolicy: IfNotPresent
        envFrom:
        - configMapRef:
            name: mid-envfile
        - configMapRef:
            name: ecm-envfile
        ports:
        - name: org-6310
          containerPort: 6310
        - name: org-16310
          containerPort: 16310
        # resources:
          # requests:
            # cpu: 800m
            # memory: 1.5Gi
          # limits:
            # cpu: 900m
            # memory: 1.6Gi
        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
