apiVersion: apps/v1
kind: Deployment
metadata:
  name: ecmweb
  namespace: edoc2
  labels:
    app: ecmweb
    k8s-app: ecmweb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ecmweb
  template:
    metadata:
      labels:
        app: ecmweb
    spec:
      hostname: ecmweb
      containers:
        - image: registry.edoc2.com:5000/edoc2v5/ecmweb:edrms-v6.5.0.1-rc14
          imagePullPolicy: IfNotPresent
          name: ecmweb
          envFrom:
            - configMapRef:
                name: ecmng-envfile
          ports:
            - name: frontend-http
              containerPort: 80
          livenessProbe:
            httpGet:
              path: /api/values
              port: frontend-http
            initialDelaySeconds: 10
            periodSeconds: 10
            timeoutSeconds: 3 # 检测时间间隔
            failureThreshold: 5 # 检测失败5次表示未就绪
            successThreshold: 1 # 检查成功为2次表示就绪
          securityContext:
            capabilities:
              add: ["SYS_PTRACE"]
      restartPolicy: Always
      nodeSelector:
        node.drive.nodelabels: InDrive
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: ecmweb
  name: ecmweb
  namespace: edoc2
spec:
  ports:
    - name: frontend-http
      port: 80
      protocol: TCP
      targetPort: 80
  selector:
    app: ecmweb
  type: ClusterIP
