apiVersion: apps/v1
kind: Deployment
metadata:
  name: data-api
spec:
  selector:
    matchLabels:
      app: data-api
  template:
    metadata:
      labels:
        app: data-api
    spec:
      terminationGracePeriodSeconds: 6
      containers:
        - name: data-api
          image: data-api
          ports:
          - containerPort: 8080
            protocol: TCP
          env:
          - name: MONGODB_USER
            valueFrom:
              secretKeyRef:
                name: mongodb
                key: MONGODB_USERNAME
          - name: MONGODB_PASSWORD
            valueFrom:
              secretKeyRef:
                name: mongodb
                key: MONGODB_PASSWORD
          resources:
            requests:
              memory: "512Mi"
              cpu: "200m"
            limits:
              memory: "1024Mi"
              cpu: "1000m"