apiVersion: apps/v1
kind: Deployment
metadata:
  name: twitter-backend
  labels:
    app: twitter-backend
spec:
  replicas: 2
  selector: 
    matchLabels: 
      app: twitter-backend
  minReadySeconds: 15
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 1
      maxSurge: 1
  template:
    metadata:
      labels:
        app: twitter-backend
    spec:
      containers:
        - image: devopschatter/twitter-server:latest
          imagePullPolicy: Always
          name: twitter-backend
          env:
            - name: MONGO_URL
              value: mongodb://mongo:27017/dev
          ports:
          - containerPort: 5000