---
apiVersion: v1
kind: Service
metadata:
  name: transport
  namespace: edoc2
  labels:
    app: transport
spec:
  ports:
  - name: transport
    port: 6261
    targetPort: 6261
    protocol: TCP
  selector:
    app: transport
  #sessionAffinity: ClientIP
  #sessionAffinityConfig:
  #  clientIP:
  #    timeoutSeconds: 5
  type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: transport
  namespace: edoc2
  labels:
    app: transport
    k8s-app: transport
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: transport
  template:
    metadata:
      labels:
        app: transport
    spec:
      hostname: transport
      terminationGracePeriodSeconds: 60
      containers:
      - name: transport-container
        image: registry.edoc2.com:5000/edoc2v5/transport:km-v6.1.0.0
        imagePullPolicy: IfNotPresent
        envFrom:
        - configMapRef:
            name: mid-envfile
        - configMapRef:
            name: ecm-envfile
        - configMapRef:
            name: inbiz-envfile
        - configMapRef:
            name: km-envfile
        - configMapRef:
            name: docflow-envfile
        ports:
        - name: transport
          containerPort: 6261
        resources:
          requests:
            cpu: 2400m
            memory: 5.8Gi
          limits:
            cpu: 2500m
            memory: 6Gi
        #volumeMounts:
        #- mountPath: /edoc2Docs
        #  name: transport-app-volume
        securityContext:
          capabilities:
            add: ["SYS_PTRACE"]
        livenessProbe:
          exec:
            command: ["curl","-L","-k","-i","http://localhost:6261/api/values|grep '200 OK'"]
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 3         # 检测时间间隔
          failureThreshold: 5       # 检测失败5次表示未就绪     
          successThreshold: 1       # 检查成功为1次表示就绪
      restartPolicy: Always
      #volumes:
      #- name: transport-app-volume
      #  nfs:
      #    server: 127.0.0.1
      #    path: /data/nas/edoc2Docs
          #hostPath:
          #  path: /home/edoc2/macrowing/edoc2v5/data/edoc2Docs
          #  type: DirectoryOrCreate
      nodeSelector:
        node.drive.nodelabels: InDrive
