apiVersion: apps/v1
kind: Deployment
metadata:
  name: how-out-of-date-are-we
  namespace: how-out-of-date-are-we
spec:
  replicas: 1
  selector:
    matchLabels:
      app: how-out-of-date-are-we-app
  template:
    metadata:
      labels:
        app: how-out-of-date-are-we-app
    spec:
      containers:
        - name: how-out-of-date-are-we
          image: ministryofjustice/cloud-platform-how-out-of-date-are-we:2.25
          env:
            - name: RACK_ENV
              value: "production"
            - name: API_KEY
              valueFrom:
                secretKeyRef:
                  name: how-out-of-date-are-we-api-key
                  key: token
            - name: DYNAMODB_REGION
              value: "eu-west-2"
            - name: DYNAMODB_ACCESS_KEY_ID
              valueFrom:
                secretKeyRef:
                  name: hoodaw-dynamodb-output
                  key: access_key_id
            - name: DYNAMODB_SECRET_ACCESS_KEY
              valueFrom:
                secretKeyRef:
                  name: hoodaw-dynamodb-output
                  key: secret_access_key
            - name: DYNAMODB_TABLE_NAME
              valueFrom:
                secretKeyRef:
                  name: hoodaw-dynamodb-output
                  key: table_name
          ports:
          - containerPort: 4567
