resource-watch/doc-executor

View on GitHub
k8s/staging/deployment.yaml

Summary

Maintainability
Test Coverage
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    name: doc-executor
  name: doc-executor
spec:
  progressDeadlineSeconds: 2147483647
  revisionHistoryLimit: 0
  selector:
    matchLabels:
      name: doc-executor
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        name: doc-executor
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: type
                    operator: In
                    values:
                      - apps
      containers:
        - args:
            - start
          env:
            - name: PORT
              value: "4003"
            - name: NODE_ENV
              value: staging
            - name: NODE_PATH
              value: app/src
            - name: ELASTIC_URL
              valueFrom:
                secretKeyRef:
                  key: ELASTIC_URL
                  name: dbsecrets
            - name: ELASTIC_USER
              valueFrom:
                secretKeyRef:
                  key: ELASTIC_USER
                  name: dbsecrets
            - name: ELASTIC_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: ELASTIC_PASSWORD
                  name: dbsecrets
            - name: STAMPERY_TOKEN
              valueFrom:
                secretKeyRef:
                  key: STAMPERY_TOKEN
                  name: mssecrets
            - name: RABBITMQ_URL
              valueFrom:
                secretKeyRef:
                  key: RABBITMQ_URI
                  name: dbsecrets
            - name: MESSAGE_RETRIES
              value: "50"
            - name: RETRY_DELAY
              value: "20000"
          image: gfwdockerhub/doc-executor
          imagePullPolicy: Always
          livenessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthcheck
              port: 4003
              scheme: HTTP
            initialDelaySeconds: 10
            periodSeconds: 15
            successThreshold: 1
            timeoutSeconds: 5
          name: doc-executor
          ports:
            - containerPort: 4003
              protocol: TCP
          readinessProbe:
            failureThreshold: 3
            httpGet:
              path: /healthcheck
              port: 4003
              scheme: HTTP
            initialDelaySeconds: 10
            periodSeconds: 15
            successThreshold: 1
            timeoutSeconds: 5
          resources:
            limits:
              cpu: "1"
              memory: 4G
            requests:
              cpu: 250m
              memory: 128M
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      imagePullSecrets:
        - name: regcred
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30