# Kubernetes deployment description for Identifiers.org Compact ID Resolution API Service
# Author: Manuel Bernal Llinares <mbdebian@gmail.com>
apiVersion: apps/v1
kind: Deployment
metadata:
    name: resolver
    namespace: idorg-satellite
spec:
    selector:
        matchLabels:
            environment: production
            tier: api
            app: resolver
            deployment: satellite
    replicas: 1
    template:
        metadata:
            labels:
                environment: production
                tier: api
                app: resolver
                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-resolver
                  image: identifiersorg/cloud-ws-resolver:2.2.6
                  imagePullPolicy: Always
                  resources:
                      requests:
                          memory: 360Mi
                          cpu: 100m
                  env:
                  - name: WS_RESOLVER_CONFIG_REDIS_HOST
                    value: "redis"
                  - name: WS_RESOLVER_CONFIG_REDIS_PORT
                    value: "6379"
                  - name: WS_RESOLVER_CONFIG_RESOURCE_RECOMMENDER_HOST
                    value: "resource-recommender"
                  - name: WS_RESOLVER_CONFIG_RESOURCE_RECOMMENDER_PORT
                    value: "8083"
                  - name: WS_RESOLVER_CONFIG_REGISTRY_RESOLUTION_DATASET_ENDPOINT
                    value: "https://registry.api.identifiers.org/resolutionApi/getResolverDataset"
                  - name: WS_RESOLVER_CONFIG_APPLICATION_CORS_ORIGINS
                    value: "*"
                  - name: WS_RESOLVER_JVM_MEMORY_MAX
                    value: "360m"
                  ports:
                  - containerPort: 8080
                  readinessProbe:
                      httpGet:
                          path: /healthApi/readiness_check
                          port: 8080
                      initialDelaySeconds: 5
                      periodSeconds: 10
                  livenessProbe:
                      httpGet:
                          path: /healthApi/liveness_check
                          port: 8080
                      initialDelaySeconds: 5
                      periodSeconds: 10
