---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mlw-api
spec:
  selector:
    matchLabels:
      app: mlw-api
  template:
    metadata:
      labels:
        app: mlw-api
    spec:
      containers:
      - name: mlw-api
        image: docker.io/imjoseangel/hacktheplanet2021:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
        resources:
          requests: # minimum resources required
            cpu: 500m
            memory: 512Mi
          limits: # maximum resources allocated
            cpu: 1000m
            memory: 1000Mi
        readinessProbe: # is the container ready to receive traffic?
          httpGet:
            port: 8080
            path: /api/ui/
        livenessProbe: # is the container healthy?
          httpGet:
            port: 8080
            path: /api/ui/
        env:
        - name: NEW_RELIC_LICENSE_KEY
          valueFrom:
            secretKeyRef:
              name: newrelic
              key: License
        - name: NEW_RELIC_APP_NAME
          value: mlw
        - name: NEW_RELIC_LOG
          value: stdout
