apiVersion: apps/v1
kind: Deployment
metadata:
  name: vote
  namespace: instavote
spec:
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 2
      maxUnavailable: 1
  revisionHistoryLimit: 4
  paused: false
  replicas: 4
  minReadySeconds: 40
  selector:
    matchLabels:
      role: vote
  template:
    metadata:
      name: vote
      labels:
        app: python
        role: vote
        version: v1
    spec:
      containers:
        - name: app
          image: schoolofdevops/vote:v1
          ports:
            - containerPort: 80
              protocol: TCP
          resources:
            limits:
              cpu: "200m"
              memory: "250Mi"
            requests:
              cpu: "100m"
              memory: "50Mi"
