---
apiVersion: v1
kind: Service
metadata:
  name: auth
  namespace: edoc2
  labels:
    app: auth
spec:
  ports:
  - name: auth-6320
    port: 6320
    targetPort: 6320
    protocol: TCP
  - name: auth-16320
    port: 16320
    targetPort: 16320
    protocol: TCP
  selector:
    app: auth
  type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: auth
  namespace: edoc2
  labels:
    app: auth
    k8s-app: auth
spec:
  replicas: 1
  selector:
    matchLabels:
      app: auth
  template:
    metadata:
      labels:
        app: auth
    spec:
      hostname: auth
      terminationGracePeriodSeconds: 30
      containers:
      - name: auth-container
        image: registry.edoc2.com:5000/edoc2v5/auth:edrms-v6.5.0.1-rc14
        imagePullPolicy: IfNotPresent
        envFrom:
        - configMapRef:
            name: mid-envfile
        - configMapRef:
            name: ecm-envfile
        ports:
        - name: auth-6320
          containerPort: 6320
        - name: auth-16320
          containerPort: 16320
        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:6320/api/values|grep '200 OK'"]
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 3         # 检测时间间隔
          failureThreshold: 5       # 检测失败5次表示未就绪     
          successThreshold: 1       # 检查成功为2次表示就绪
      restartPolicy: Always
      nodeSelector:
        "node.drive.nodelabels": InDrive
