apiVersion: apps/v1
kind: Deployment
metadata:
  name: cms-deployment
  namespace: default
spec:
  #  minReadySeconds: 240
  revisionHistoryLimit: 2
  replicas: 1
  selector:
    matchLabels:
      app: cms
  template:
    metadata:
      labels:
        app: cms
        swck-java-agent-injected: 'true'
    spec:
      containers:
        - name: cms
          image: REGISTRY/NAMESPACE/IMAGE:TAG
          readinessProbe:
            initialDelaySeconds: 15
            periodSeconds: 5
            #timeoutSeconds: 1
            #successThreshold: 1
            failureThreshold: 10
            httpGet:
              path: /userapp/actuator/health/readiness
              port: cms-port
          volumeMounts:
            - name: log-of-app
              mountPath: /var/log/app
            - name: localtime
              mountPath: /etc/localtime
              readOnly: true
          resources: { }
          #            limits:
          #              memory: 1024Mi
          #              cpu: 100m
          ports:
            - containerPort: 35150
              name: cms-port
          env:
            - name: SPRING_PROFILES_ACTIVE
              valueFrom:
                configMapKeyRef:
                  name: cms-map
                  key: SPRING_PROFILES_ACTIVE
            - name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
              valueFrom:
                configMapKeyRef:
                  name: cms-map
                  key: SW_AGENT_COLLECTOR_BACKEND_SERVICES
            - name: SW_AGENT_NAME
              valueFrom:
                configMapKeyRef:
                  name: cms-map
                  key: SW_AGENT_NAME
            - name: MYSQL_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: iuav-secret
                  key: MYSQL_PASSWORD
            - name: REDIS_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: iuav-secret
                  key: REDIS_PASSWORD
            - name: OSS_ACCESS_KEY_SECRET
              valueFrom:
                secretKeyRef:
                  name: iuav-secret
                  key: OSS_ACCESS_KEY_SECRET
            - name: WECHAT_SUB_SECRET
              valueFrom:
                secretKeyRef:
                  name: iuav-secret
                  key: WECHAT_SUB_SECRET
            - name: WECHAT_APPLET_SECRET
              valueFrom:
                secretKeyRef:
                  name: iuav-secret
                  key: WECHAT_APPLET_SECRET
            - name: RABBITMQ_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: iuav-secret
                  key: RABBITMQ_PASSWORD
      volumes:
        - name: log-of-app
          hostPath:
            path: /var/log/app
        - name: localtime
          hostPath:
            path: /etc/localtime