apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: default
  labels:
    name: mt-geotrainer
    app: validator
  name: mt-geotrainer
spec:
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      name: mt-geotrainer
  template:
    metadata:
      labels:
        name: mt-geotrainer
    spec:
      containers:
      - name: mt-geotrainer
        image: skydipper/mt-geotrainer
        imagePullPolicy: Always
        resources:
          requests:
            memory: "128Mi"
          limits:
            memory: "512Mi"
        args:
          - start
        env:
          - name: PORT
            value: "6767"
          - name: ENVIRONMENT
            value: prod
          - name: LOCAL_URL
            value: http://mt-geotrainer.default.svc.cluster.local:6767
          - name: CT_URL
            valueFrom:
                secretKeyRef:
                  name: mssecrets
                  key: CT_URL
          - name: CT_TOKEN
            valueFrom:
                secretKeyRef:
                  name: mssecrets
                  key: CT_TOKEN
          - name: CT_REGISTER_MODE
            valueFrom:
                secretKeyRef:
                  name: mssecrets
                  key: CT_REGISTER_MODE
          - name: API_VERSION
            valueFrom:
                secretKeyRef:
                  name: mssecrets
                  key: API_VERSION
          - name: GEO_PREDICTOR_SERVICE_EMAIL
            valueFrom:
              secretKeyRef:
                name: mssecrets
                key: GEO_PREDICTOR_SERVICE_EMAIL
          - name: EE_PRIVATE_KEY
            valueFrom:
              secretKeyRef:
                name: mssecrets
                key: EE_GEE_TILE_PRIVATE_KEY
          - name: POSTGRES_CONNECTION
            valueFrom:
                secretKeyRef:
                  name: dbsecrets
                  key: GEOPREDICTOR_POSTGRESQL_URI
        ports:
          - containerPort: 6767
      restartPolicy: Always
