kind: Deployment
apiVersion: apps/v1
metadata:
  name: cmii-uav-ai-core
  namespace: 修改命名空间
  labels:
    app.kubernetes.io/app-version: 6.2.0
    app.kubernetes.io/managed-by: octopus
    cmii.app: cmii-uav-ai-core
    cmii.type: backend
    octopus/control: backend-app-1.0.0
spec:
  replicas: 1
  selector:
    matchLabels:
      cmii.app: cmii-uav-ai-core
      cmii.type: backend
  template:
    metadata:
      labels:
        cmii.app: cmii-uav-ai-core
        cmii.type: backend
    spec:
      volumes:
        - name: nfs-backend-log-volume
          persistentVolumeClaim:
            claimName: nfs-backend-log-pvc
      containers:
        - name: cmii-uav-ai-core
          image: 修改Harbor地址/cmii/cmii-uav-ai-core:5.7.0-shidian202603
          ports:
            - name: pod-port
              containerPort: 8080
              protocol: TCP
          env:
            - name: K8S_NAMESPACE
              value: uavcloud-devflight
            - name: APPLICATION_NAME
              value: cmii-uav-ai-core
            - name: CUST_JAVA_OPTS
              value: '-Xms200m -Xmx1500m -Dlog4j2.formatMsgNoLookups=true'
            - name: NACOS_REGISTRY
              value: helm-nacos.cqejpt.svc.cluster.local:8848
            - name: NACOS_DISCOVERY_IP
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: status.podIP
            - 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
            - name: NACOS_USERNAME
              value: developer
            - name: NACOS_PASSWORD
              value: Deve@9128201
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.name
            - name: POD_NAMESPACE
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: metadata.namespace
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: spec.nodeName
            - name: NODE_IP
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: status.hostIP
            - name: LIMIT_CPU
              valueFrom:
                resourceFieldRef:
                  containerName: cmii-uav-ai-core
                  resource: limits.cpu
                  divisor: '0'
            - name: LIMIT_MEMORY
              valueFrom:
                resourceFieldRef:
                  containerName: cmii-uav-ai-core
                  resource: limits.memory
                  divisor: '0'
            - name: REQUEST_CPU
              valueFrom:
                resourceFieldRef:
                  containerName: cmii-uav-ai-core
                  resource: requests.cpu
                  divisor: '0'
            - name: REQUEST_MEMORY
              valueFrom:
                resourceFieldRef:
                  containerName: cmii-uav-ai-core
                  resource: requests.memory
                  divisor: '0'
          resources:
            limits:
              cpu: '2'
              memory: 3Gi
            requests:
              cpu: 300m
              memory: 512Mi
          volumeMounts:
            - name: nfs-backend-log-volume
              mountPath: /cmii/logs
              subPath: uavcloud-devflight/cmii-uav-ai-core
          livenessProbe:
            httpGet:
              path: /cmii/health
              port: pod-port
              scheme: HTTP
            initialDelaySeconds: 60
            timeoutSeconds: 5
            periodSeconds: 20
            successThreshold: 1
            failureThreshold: 3
          readinessProbe:
            httpGet:
              path: /cmii/health
              port: pod-port
              scheme: HTTP
            initialDelaySeconds: 60
            timeoutSeconds: 5
            periodSeconds: 20
            successThreshold: 1
            failureThreshold: 3
          startupProbe:
            httpGet:
              path: /cmii/health
              port: pod-port
              scheme: HTTP
            initialDelaySeconds: 60
            timeoutSeconds: 3
            periodSeconds: 20
            successThreshold: 1
            failureThreshold: 5
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      imagePullSecrets:
        - name: harborsecret
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: uavcloud.env
                    operator: In
                    values:
                      - 修改命名空间
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600
---
kind: Service
apiVersion: v1
metadata:
  name: cmii-uav-ai-core
  namespace: 修改命名空间
  labels:
    app.kubernetes.io/app-version: 6.2.0
    app.kubernetes.io/managed-by: octopus
    cmii.app: cmii-uav-ai-core
    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-uav-ai-core
    cmii.type: backend
  type: ClusterIP

