apiVersion: apps/v1
kind: Deployment
metadata:
  name: ec
  labels:
    app: ec
    version: v1
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ec
      version: v1
  template:
    metadata:
      annotations: 
        'cni.projectcalico.org/ipv4pools': "[\"office-net\"]"
      labels:
        app: ec
        version: v1
    spec:
      dnsPolicy: ClusterFirstWithHostNet
      imagePullSecrets:
        - name: gianthub-registry-key
      containers:
        - name: ec
          image: docker-registry.ztgame.com.cn/im/mediasoup-signal:1.0.2
          args: ["--erizoController"]
          imagePullPolicy: IfNotPresent
          lifecycle:
            preStop:
              exec:
                command:
                  - /bin/bash
                  - /opt/mediasoup-signal/erizo_controller/erizoController/prestop.sh
          livenessProbe:
            failureThreshold: 3
            initialDelaySeconds: 15
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 8080
            timeoutSeconds: 1
          readinessProbe:
            failureThreshold: 3
            initialDelaySeconds: 15
            periodSeconds: 10
            successThreshold: 1
            tcpSocket:
              port: 8080
            timeoutSeconds: 1
          resources:
            requests:
              memory: "64Mi"
              cpu: "250m"
            limits:
              memory: "128Mi"
              cpu: "500m"
          ports:
          - containerPort: 8080
          
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
           - name: licode-data
             mountPath: /opt/mediasoup-signal/licode_config.js
             subPath: licode_config.js
      terminationGracePeriodSeconds: 1800
      volumes:
        - name: licode-data
          configMap:
            name: licode-config