apiVersion: v1
kind: Service
metadata:
  name: clientsync
  namespace: edoc2
  labels:
    app: clientsync
spec:
  ports:
  - name: clientsync-6350
    port: 6350
    targetPort: 6350
    protocol: TCP
  - name: sync-16350
    port: 16350
    targetPort: 16350
    protocol: TCP
  selector:
    app: clientsync
  type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: clientsync
  namespace: edoc2
  labels:
    app: clientsync
    k8s-app: clientsync
spec:
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: clientsync
  template:
    metadata:
      labels:
        app: clientsync
    spec:
      hostname: clientsync
      terminationGracePeriodSeconds: 60
      containers:
      - name: clientsync-container
        image: 192.168.251.78/edoc2v5/clientsync:20230714092417
        imagePullPolicy: IfNotPresent
        envFrom:
        - configMapRef:
            name: ecm-envfile
        - configMapRef:
            name: mid-envfile
        ports:
        - name: clientsync-6350
          containerPort: 6350
        - name: sync-16350
          containerPort: 16350
        resources:
          requests:
            cpu: 500m
            memory: 1Gi
          limits:
            cpu: 800m
            memory: 1Gi
        securityContext:
          capabilities:
            add: ["SYS_PTRACE"]
        livenessProbe:
          exec:
            command: ["curl", "-L", "-k", "-i", "http://localhost:6350/api/values|grep '200 OK'"]
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 3 # 检测时间间隔
          failureThreshold: 5 # 检测失败5次表示未就绪     
          successThreshold: 1 # 检查成功为2次表示就绪
      restartPolicy: Always
      nodeSelector:
        node.drive.nodelabels: InDrive
