apiVersion: apps/v1
kind: Deployment
metadata:
  name: rails-app
  labels:
    app: rails-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: rails-app
  template:
    metadata:
      labels:
        app: rails-app
    spec:
      containers:
      - name: rails
        image: cindyliu923/notes-rails-api:0.3.0
        ports:
        - containerPort: 3000
        env:
          - name: AUTO_MIGRATION
            value: 'yes'
          - name: DATABASE_URL
            valueFrom:
               secretKeyRef:
                  name: postgres-secret
                  key: DATABASE_URL
