apiVersion: apps/v1
kind: Deployment
metadata:
  name: ecommerce-go-api
spec:
  selector:
    matchLabels:
      app: ecommerce-go-api
  replicas: 2
  template:
    metadata:
      labels:
        app: ecommerce-go-api
    spec:
      containers:
        - name: ecommerce-go-api 
          image: tjmaynes/ecommerce-go-api:latest
          imagePullPolicy: "IfNotPresent"
          ports:
            - containerPort: 5000
          env:
            - name: DATABASE_URL
              valueFrom:
                secretKeyRef:
                  name: ecommerce-go-api-secrets
                  key: db-uri
