---
kind: ConfigMap
apiVersion: v1
metadata:
  name: pyfusion-configmap
  namespace: uavcloud-devflight
data:
  config.yaml: |-
    mqtt:
      broker: "helm-emqxs"
      port: 1883
      username: "cmlc"
      password: "4YPk*DS%+5"

    topics:
      mqtt_topic: "bridge/DP74b4ef9fb4aaf269/device_data/FU_PAM/+"
      sensor_topic: "fromcheck/DP74b4ef9fb4aaf269/device_data/FU_PAM/+"
---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: cmii-uavms-pyfusion
  namespace: uavcloud-devflight
  labels:
    app.kubernetes.io/app-version: 6.2.0
    app.kubernetes.io/managed-by: octopus-control
    cmii.app: cmii-uavms-pyfusion
    cmii.type: backend
    octopus/control: backend-app-1.0.0
spec:
  replicas: 1
  selector:
    matchLabels:
      cmii.app: cmii-uavms-pyfusion
      cmii.type: backend
  template:
    metadata:
      creationTimestamp: null
      labels:
        cmii.app: cmii-uavms-pyfusion
        cmii.type: backend
    spec:
      volumes:
        - name: nfs-backend-log-volume
          persistentVolumeClaim:
            claimName: nfs-backend-log-pvc
        - name: pyfusion-conf
          configMap:
            name: pyfusion-configmap
            items:
              - key: config.yaml
                path: config.yaml
      containers:
        - name: cmii-uavms-pyfusion
          image: 'harbor.cdcyy.com.cn/cmii/cmii-uavms-pyfusion:6.2.0'
          ports:
            - name: pod-port
              containerPort: 8080
              protocol: TCP
          env:
            - name: VERSION
              value: 6.2.0
            - name: NACOS_SYSTEM_CONFIG_NAME
              value: cmii-backend-system
            - name: NACOS_SERVICE_CONFIG_NAME
              value: cmii-uavms-pyfusion
            - name: NACOS_SERVER_ADDRESS
              value: 'helm-nacos:8848'
            - name: K8S_NAMESPACE
              value: uavcloud-devflight
            - name: APPLICATION_NAME
              value: cmii-uavms-pyfusion
            - name: NACOS_DISCOVERY_PORT
              value: '8080'
            - name: BIZ_CONFIG_GROUP
              value: 6.2.0
            - name: SYS_CONFIG_GROUP
              value: 6.2.0
            - name: IMAGE_VERSION
              value: 6.2.0
          resources:
            limits:
              cpu: '2'
              memory: 3Gi
            requests:
              cpu: 200m
              memory: 500Mi
          volumeMounts:
            - name: nfs-backend-log-volume
              mountPath: /cmii/logs
              subPath: uavcloud-devflight/cmii-uavms-pyfusion
            - name: pyfusion-conf
              mountPath: /app/config.yaml
              subPath: config.yaml
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: { }
      imagePullSecrets:
        - name: harborsecret
      affinity: { }
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600
---
kind: Service
apiVersion: v1
metadata:
  name: cmii-uavms-pyfusion
  namespace: uavcloud-devflight
  labels:
    app.kubernetes.io/app-version: 6.2.0
    app.kubernetes.io/managed-by: octopus-control
    cmii.app: cmii-uavms-pyfusion
    cmii.type: backend
    octopus/control: backend-app-1.0.0
spec:
  ports:
    - name: backend-tcp
      protocol: TCP
      port: 8080
      targetPort: 8080
  selector:
    cmii.app: cmii-uavms-pyfusion
    cmii.type: backend
  type: ClusterIP
  sessionAffinity: None



