apiVersion: apps/v1
kind: Deployment
metadata:
  name: translation-api
spec:
  selector:
    matchLabels:
      app: translation-api
  template:
    metadata:
      labels:
        app: translation-api
    spec:
      containers:
        - name: translation-api
          image: ghcr.io/project-mtee/translation-api-service:latest
          env:
            - name: Services__RabbitMQ__Host
              value: $(RABBITMQ_SERVICE_HOST)
            - name: Services__RabbitMQ__Port
              value: $(RABBITMQ_SERVICE_PORT)
            - name: Services__RabbitMQ__UserName
              valueFrom:
                secretKeyRef:
                  key: username
                  name: rabbitmq
            - name: Services__RabbitMQ__Password
              valueFrom:
                secretKeyRef:
                  key: password
                  name: rabbitmq
            - name: Services__TranslationSystem__Url
              valueFrom:
                configMapKeyRef:
                  key: translation-api
                  name: hosts
          ports:
            - containerPort: 80
          livenessProbe:
            httpGet:
              path: /health/live
              port: 80
            initialDelaySeconds: 10
          readinessProbe:
            httpGet:
              path: /health/ready
              port: 80
            initialDelaySeconds: 10
          resources:
            requests:
              memory: "512Mi"
              cpu: "1.0"
            limits:
              memory: "512Mi"