apiVersion: apps/v1
kind: Deployment
metadata:
  name: gateway
  namespace: "{{namespace}}"
spec:
  selector:
    matchLabels:
      app: gateway
  replicas: 1
  template:
    metadata:
      labels:
        app: gateway
    spec:
      containers:
      - name: gateway
        image: oxyl/gateway:{{tag}}
        imagePullPolicy: Always
        env:
          - name: NODE_ENV
            valueFrom:
              configMapKeyRef:
                name: config
                key: environment
          - name: PG_DATABASE
            valueFrom:
              configMapKeyRef:
                name: config
                key: database
          - name: PG_USER
            valueFrom:
              secretKeyRef:
                name: postgres
                key: user
          - name: PG_PASSWORD
            valueFrom: 
              secretKeyRef:
                name: postgres
                key: password
        ports:
        - containerPort: 8500
          name: http