apiVersion: apps/v1
kind: Deployment
metadata:
  name: static-resource
  namespace: edoc2
  labels:
    app: static-resource
    k8s-app: static-resource
spec:
  replicas: 3
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: static-resource
  template:
    metadata:
      labels:
        app: static-resource
    spec:
      hostname: static-resource
      terminationGracePeriodSeconds: 60
      containers:
        - image: registry.edoc2.com:5000/edoc2v5/static-resource:edrms-v6.5.0.1-rc16
          imagePullPolicy: IfNotPresent
          name: static-resource
          envFrom:
            - configMapRef:
                name: mid-envfile
            - configMapRef:
                name: inbiz-envfile
          ports:
            - name: resource-http
              containerPort: 5001
            - name: resource-grpc
              containerPort: 15001
          livenessProbe:
            httpGet:
              path: /api/values
              port: resource-http
            initialDelaySeconds: 60
            periodSeconds: 10
            timeoutSeconds: 3 # 检测时间间隔
            failureThreshold: 5 # 检测失败5次表示未就绪
            successThreshold: 1 # 检查成功为2次表示就绪
          # volumeMounts:
          #   - mountPath: /tmp/dump/
          #     name: temp
          securityContext:
            capabilities:
              add: ["SYS_PTRACE"]
      restartPolicy: Always
      # volumes:
      #   - name: temp
      #     hostPath:
      #       path: /tmp/dump/
      #       type: DirectoryOrCreate
      nodeSelector:
        node.drive.nodelabels: InDrive
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: static-resource
  name: static-resource
  namespace: edoc2
spec:
  ports:
    - name: resource-http
      port: 5001
      protocol: TCP
      targetPort: 5001
    - name: resource-grpc
      port: 15001
      protocol: TCP
      targetPort: 15001
  selector:
    app: static-resource
  type: ClusterIP
