apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: gfw
    name: gfw-guira
  name: gfw-guira
  namespace: gfw
spec:
  progressDeadlineSeconds: 2147483647
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      name: gfw-guira
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        name: gfw-guira
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: type
                    operator: In
                    values:
                      - gfw
      containers:
        - args:
            - start
          env:
            - name: PORT
              value: "3600"
            - name: NODE_ENV
              value: prod
            - name: NODE_PATH
              value: app/src
            - name: LOCAL_URL
              value: http://gfw-guira.gfw.svc.cluster.local:3600
            - 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: CARTODB_USER
              valueFrom:
                secretKeyRef:
                  key: CARTODB_USER
                  name: mssecrets
            - name: FASTLY_ENABLED
              valueFrom:
                secretKeyRef:
                  key: FASTLY_ENABLED
                  name: mssecrets
            - name: FASTLY_APIKEY
              valueFrom:
                secretKeyRef:
                  key: FASTLY_APIKEY
                  name: mssecrets
                  optional: true
            - name: FASTLY_SERVICEID
              valueFrom:
                secretKeyRef:
                  key: FASTLY_SERVICEID
                  name: mssecrets
                  optional: true
          image: gfwdockerhub/gfw-guira
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthcheck
              port: 3600
              scheme: HTTP
            initialDelaySeconds: 30
            periodSeconds: 15
            successThreshold: 1
            timeoutSeconds: 5
          name: gfw-guira
          ports:
            - containerPort: 3600
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthcheck
              port: 3600
              scheme: HTTP
            initialDelaySeconds: 30
            periodSeconds: 15
            successThreshold: 1
            timeoutSeconds: 5
          resources:
            limits:
              cpu: "1"
              memory: 512M
            requests:
              cpu: 250m
              memory: 256M
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      imagePullSecrets:
        - name: regcred
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: { }
      terminationGracePeriodSeconds: 30
