kind: Deployment
apiVersion: apps/v1
metadata:
  name: braze-history-upload-<PLATFORM>
  namespace: airlytics
  labels:
    app: braze-history-upload
  annotations:
    deployment.kubernetes.io/revision: '3'
spec:
  replicas: 1
  selector:
    matchLabels:
      app: braze-history-upload
  template:
    metadata:
      labels:
        app: braze-history-upload
    spec:
      nodeSelector:
        pod-type: <POD_TYPE>
      containers:
        - name: braze-history-upload
          image: <IMAGE_STORE_SERVER>/airlytics/braze-history-upload:latest
          ports:
            - containerPort: 8081
              name: web
              protocol: TCP
          env:
            - name: USERS_PLATFORM
              value: '<PLATFORM>'
            - name: BRAZE_API_ENABLED
              value: 'true'
            - name: INSTALL_TRIAL_SHARD
              value: '85'
            - name: SUB_SHARD
              value: '0'
            - name: SHARDS_PAUSE_AFTER
              value: '20'
            - name: SHARDS_PAUSE_MS
              value: '100000'
            - name: BRAZE_API_KEY
              valueFrom:
                secretKeyRef:
                  name: third-party-api-secret
                  key: braze-ios-key
            - name: DB_URL
              value: 'jdbc:postgresql://<DB_SERVER>:5432/users?currentSchema=users'
            - name: DB_USER_NAME
              value: 'airlytics_all_ro'
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: userdb-secret
                  key: airlytics-all-ro
          livenessProbe:
            httpGet:
              path: /healthcheck/is-alive
              port: web
            initialDelaySeconds: 30
            periodSeconds: 30
          readinessProbe:
            httpGet:
              path: /healthcheck/is-ready
              port: web
            initialDelaySeconds: 30
            periodSeconds: 30
          resources:
            limits:
              memory: 512Mi
            requests:
              memory: 512Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      securityContext: {}
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600