apiVersion: apps/v1
kind: Deployment
metadata:
  name: transaction-app
  namespace: fsi
spec:
  selector:
    matchLabels:
      app: transaction-app
  replicas: 1
  template:
    metadata:
      labels:
        app: transaction-app
    spec:
      containers:
        - name: transaction-app-container
          image: transactionservice
          resources:
            limits:
              cpu: "400m"
              memory: 512Mi
            requests:
              cpu: "200m"
              memory: 256Mi
          ports:
            - name: http
              containerPort: 5050
          env:
            - name: "PROJECT_ID"
              valueFrom:
                configMapKeyRef:
                  name: env-vars
                  key: env.project-id
            - name: "GOOGLE_APPLICATION_CREDENTIALS_PATH"
              value: "/var/goog/secrets/service-acc.json"
            - name: PROFILE_SVC_URL
              value: "http://go-app-svc:8080"
          volumeMounts:
            - name: "service-account"
              mountPath: "/var/goog/secrets"
              readOnly: true
      volumes:
        - name: "service-account"
          secret:
            secretName: svc-key
