# Kubernetes deployment description for Identifiers.org Metadata Resolution API Service
# Author: Manuel Bernal Llinares <mbdebian@gmail.com>
apiVersion: apps/v1
kind: Deployment
metadata:
    name: metadata
    namespace: idorg-satellite
spec:
    selector:
        matchLabels:
            environment: production
            tier: api
            app: metadata
            deployment: satellite
    replicas: 1
    template:
        metadata:
            labels:
                environment: production
                tier: api
                app: metadata
                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-metadata
                  image: identifiersorg/cloud-ws-metadata:1.4.2
                  imagePullPolicy: Always
                  resources:
                      requests:
                          memory: 640Mi
                  env:
                  - name: WS_METADATA_CONFIG_RESOLVER_HOST
                    value: "resolver"
                  - name: WS_METADATA_CONFIG_RESOLVER_PORT
                    value: "8080"
                  - name: WS_METADATA_JVM_MEMORY_MAX
                    value: "512m"
                  - name: WS_METADATA_CONFIG_REDIS_HOST
                    value: "redis"
                  ports:
                  - containerPort: 8082
                  readinessProbe:
                      httpGet:
                          path: /healthApi/readiness_check
                          port: 8082
                      initialDelaySeconds: 5
                      periodSeconds: 10
                  livenessProbe:
                      httpGet:
                          path: /healthApi/liveness_check
                          port: 8082
                      initialDelaySeconds: 5
                      periodSeconds: 10
