apiVersion: apps/v1
kind: Deployment
metadata:
    name: goldmund-api-deployment
spec:
    replicas: 2
    selector:
        matchLabels:
            component: api
    template:
        metadata:
            labels:
                component: api
        spec:
            containers:
                - name: goldmund-api
                  image: exbotanical/goldmund-api
                  ports:
                    - containerPort: 5000
                  env:
                    - name: PORT
                      value: "5000"
                    - name: REDIS_HOST
                      value: redis-service
                    - name: REDIS_PORT
                      value: "6379"
                    - name: EPHEMERAL_LOGS_PATH
                      value: /usr/src/app/logs
                    - name: MONGO_ATLAS_URI
                      valueFrom:
                        secretKeyRef:
                            name: goldmund-ledger
                            key: MONGO_ATLAS_URI
                    - name: REDIS_PASSWORD
                      valueFrom:
                        secretKeyRef:
                            name: goldmund-ledger
                            key: REDIS_PASSWORD
                    - name: JWT_SECRET
                      valueFrom:
                        secretKeyRef:
                            name: goldmund-ledger
                            key: JWT_SECRET
                    - name: JWT_AUTHORITY
                      valueFrom:
                        secretKeyRef:
                            name: goldmund-ledger
                            key: JWT_AUTHORITY
                    - name: JWT_ALGORITHM
                      valueFrom:
                        secretKeyRef:
                            name: goldmund-ledger
                            key: JWT_ALGORITHM
                    - name: JWT_EMAIL
                      valueFrom:
                        secretKeyRef:
                            name: goldmund-ledger
                            key: JWT_EMAIL
                    - name: RSA_PRIV
                      valueFrom:
                        secretKeyRef:
                            name: goldmund-ledger
                            key: RSA_PRIV
                    - name: RSA_PUB
                      valueFrom:
                        secretKeyRef:
                            name: goldmund-ledger
                            key: RSA_PUB
