kind: ConfigMap
apiVersion: v1
metadata:
  name: cmii-uav-tsmpf-cm
  namespace: szgz
data:
  server_config_docker.ini: >
    #minio=mc alias set minIO https://oss.demo.uavcmlc.com:18000/      cmii 
    B#923fC7mk

    minio=mc alias set minIO  http://172.31.2.7:9000/   cmii  B#923fC7mk  

    http_port=8192

    docker_logs_path=/workspace/logs

    docker_temp_folder=/workspace/temp_folder

    mp4_file_size=500

    upload_url=no used.

    query_file_url=no used.

    download_url=no_useful_now.

    send_complete_msg_url=no used.

    logs_path=/workspace/logs

    temp_folder=/workspace/temp_folder

    #需要排除的合并任务(这些任务由于ts文件不存在，导致无法成功)

    exclude_task_codes=

    #是否执行playback的任务,0:false;  1:true;

    merge_playback=1

    #下载ts文件方式，http, mc

    download_type=mc

    #仅合成某个公司的文件;(可用于希望优先下载某个公司的文件的场景); 数字半角逗号分割;

    only_download_company_ids=


    #是否记录磁盘日志; 0:false, 1:true

    log_to_disk=1

    #(integer)日志级别; 1:error, 2:warn, 3:info, 4:debug

    log_level=2

---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: cmii-uav-tsmpf
  namespace: szgz
  labels:
    app.kubernetes.io/app-version: 6.2.0
    app.kubernetes.io/managed-by: octopus-control
    cmii.app: cmii-uav-tsmpf
    cmii.type: backend
    octopus/control: backend-app-1.0.0
spec:
  replicas: 1
  selector:
    matchLabels:
      cmii.app: cmii-uav-tsmpf
      cmii.type: backend
  template:
    metadata:
      creationTimestamp: null
      labels:
        cmii.app: cmii-uav-tsmpf
        cmii.type: backend
    spec:
      volumes:
        - name: nfs-backend-log-volume
          emptyDir: {}
        - name: server-config-docker
          configMap:
            name: cmii-uav-tsmpf-cm
            items:
              - key: server_config_docker.ini
                path: server_config_docker.ini
      containers:
        - name: cmii-uav-tsmpf
          image: '172.31.2.7:8033/admin/cmii/ts2mp4_docker_image_arm64:v1.1.0'
          command:
            - /workspace/ts_file_merge
            - /workspace/server_config_docker.ini
          ports:
            - name: pod-port
              containerPort: 8192
              protocol: TCP
          env:
            - name: K8S_NAMESPACE
              value: szgz
            - name: APPLICATION_NAME
              value: cmii-uav-tsmpf
          resources:
            requests:
              cpu: 500m
              memory: 2Gi
          volumeMounts:
            - name: nfs-backend-log-volume
              mountPath: /cmii/logs
              subPath: szgz/cmii-uav-tsmpf
            - name: server-config-docker
              mountPath: /workspace/server_config_docker.ini
              subPath: server_config_docker.ini
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: uavcloud.env
                    operator: In
                    values:
                      - szgz
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600

---
kind: Service
apiVersion: v1
metadata:
  name: cmii-uav-tsmpf
  namespace: szgz
  labels:
    app.kubernetes.io/app-version: 6.2.0
    app.kubernetes.io/managed-by: octopus-control
    cmii.app: cmii-uav-tsmpf
    cmii.type: backend
    octopus/control: backend-app-1.0.0
 
spec:
  ports:
    - name: backend-tcp
      protocol: TCP
      port: 8192
      targetPort: 8192
      nodePort: 38192
  selector:
    cmii.app: cmii-uav-tsmpf
    cmii.type: backend
  type: NodePort

