# Kubernetes deployment description for Identifiers.org Link Checker Service
# Author: Manuel Bernal Llinares <mbdebian@gmail.com>
apiVersion: apps/v1
kind: Deployment
metadata:
    name: link-checker
    namespace: idorg-satellite
spec:
    selector:
        matchLabels:
            environment: production
            tier: api
            app: link-checker
            deployment: satellite
    replicas: 1
    template:
        metadata:
            labels:
                environment: production
                tier: api
                app: link-checker
                deployment: satellite
        spec:
            tolerations:
            - key: "idorg-node-reliability"
              operator: "Equal"
              value: "ephemeral"
              effect: "PreferNoSchedule"
            affinity:
              nodeAffinity:
                preferredDuringSchedulingIgnoredDuringExecution:
                  - weight: 5
                    preference:
                      matchExpressions:
                        - key: idorg-node-reliability
                          operator: In
                          values:
                            - stable
            containers:
                - name: cloud-ws-link-checker
                  image: identifiersorg/cloud-ws-link-checker:1.3.2
                  imagePullPolicy: Always
                  resources:
                      requests:
                          memory: 440Mi
                          cpu: 100m
                  env:
                  - name: WS_LINK_CHECKER_JVM_MEMORY_MAX
                    value: "420m"
                  - name: WS_LINK_CHECKER_CONFIG_REDIS_HOST
                    value: "redis"
                  - name: WS_LINK_CHECKER_CONFIG_BACKEND_SERVICE_RESOLVER_HOST
                    value: "resolver"
                  # Keep link checking history for only 1.5 days
                  - name: WS_LINK_CHECKER_CONFIG_BACKEND_DATA_LINK_CHECK_RESULTS_TTL_SECONDS
                    value: "129600"
                  ports:
                  - containerPort: 8084
                  readinessProbe:
                      httpGet:
                          path: /healthApi/readiness_check
                          port: 8084
                      initialDelaySeconds: 5
                      periodSeconds: 10
                  livenessProbe:
                      httpGet:
                          path: /healthApi/liveness_check
                          port: 8084
                      initialDelaySeconds: 5
                      periodSeconds: 10
