apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    sidecar.jaegertracing.io/inject: jaeger
  name: aipower-api
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: aipower-api
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: aipower-api
    spec:
      containers:
        - command:
            - api
          env:
            - name: JAEGER_SERVICE_NAME
              value: aipower-api.nightly-ms
            - name: JAEGER_PROPAGATION
              value: jaeger,b3,w3c
          envFrom:
            - secretRef:
                name: aipower-secret-config
          image: aipower:latest
          imagePullPolicy: IfNotPresent
          name: api
          resources:
            limits:
              cpu: 100m
              memory: 256Mi
            requests:
              cpu: 100m
              memory: 256Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /etc/dbaas
              name: aipower-conf
              readOnly: true
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: central
      serviceAccountName: central
      terminationGracePeriodSeconds: 30
      volumes:
        - configMap:
            defaultMode: 420
            name: aipower-conf
          name: aipower-conf
---
apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    sidecar.jaegertracing.io/inject: jaeger
  name: aipower-offline
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: aipower-offline
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: aipower-offline
    spec:
      containers:
        - command:
            - api
          env:
            - name: JAEGER_SERVICE_NAME
              value: aipower-offline.nightly-ms
            - name: JAEGER_PROPAGATION
              value: jaeger,b3,w3c
          envFrom:
            - secretRef:
                name: aipower-secret-config
          image: aipower:latest
          imagePullPolicy: IfNotPresent
          name: offline
          resources:
            limits:
              cpu: 100m
              memory: 256Mi
            requests:
              cpu: 100m
              memory: 256Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /etc/dbaas
              name: aipower-conf-offline
              readOnly: true
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccount: central
      serviceAccountName: central
      terminationGracePeriodSeconds: 30
      volumes:
        - configMap:
            defaultMode: 420
            name: aipower-conf-offline
          name: aipower-conf-offline
