apiVersion: apps/v1
kind: Deployment
metadata:
  name:  flask-database
  labels:
    name:  flask-database
    app: flask-database
spec:
  selector:
    matchLabels:
      app: flask-database
      name: flask-database
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      labels:
        name:  flask-database
        app: flask-database
    spec:
      containers:
      - image:  harshthakur/flask-mongodb:latest
        name:  database-api
        command: ["flask" ,"run","--host=0.0.0.0","--port=5000"]
        env:
        - name:  FLASK_APP
          value:  database.py
        - name: FLASK_DEBUG
          value: "1"       
        ports:
        - containerPort:  5000
          name:  flask-database
        imagePullPolicy: Never
        resources:
          limits:
            memory: "300Mi"
            cpu: "500m"