apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: validator
    name: geopredictor
  name: geopredictor
  namespace: default
spec:
  progressDeadlineSeconds: 2147483647
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      name: geopredictor
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        name: geopredictor
    spec:
      containers:
        - args:
            - start
          env:
            - name: PORT
              value: "4506"
            - name: ENVIRONMENT
              value: prod
            - name: LOCAL_URL
              value: http://geopredictor.default.svc.cluster.local:4506
            - name: CT_URL
              valueFrom:
                secretKeyRef:
                  key: CT_URL
                  name: mssecrets
            - name: CT_TOKEN
              valueFrom:
                secretKeyRef:
                  key: CT_TOKEN
                  name: mssecrets
            - name: CT_REGISTER_MODE
              valueFrom:
                secretKeyRef:
                  key: CT_REGISTER_MODE
                  name: mssecrets
            - name: API_VERSION
              valueFrom:
                secretKeyRef:
                  key: API_VERSION
                  name: mssecrets
            - name: GEO_PREDICTOR_SERVICE_EMAIL
              valueFrom:
                secretKeyRef:
                  key: GEO_PREDICTOR_SERVICE_EMAIL
                  name: mssecrets
            - name: EE_PRIVATE_KEY
              valueFrom:
                secretKeyRef:
                  key: EE_GEE_TILE_PRIVATE_KEY
                  name: mssecrets
            - name: EE_PROJECT_ID
              valueFrom:
                secretKeyRef:
                  key: EE_PROJECT_ID
                  name: mssecrets
            - name: POSTGRES_CONNECTION
              valueFrom:
                secretKeyRef:
                  key: GEOPREDICTOR_POSTGRESQL_URI
                  name: dbsecrets
          image: skydipper/geopredictor:develop.24
          imagePullPolicy: Always
          name: geopredictor
          ports:
            - containerPort: 4506
              protocol: TCP
          resources:
            limits:
              memory: 512Mi
            requests:
              memory: 128Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: { }
      terminationGracePeriodSeconds: 30
      tolerations:
        - effect: NoSchedule
          key: type
          operator: Equal
          value: validator
