apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: coffee-webshop
    release: v1.0
  name: coffee-shop
  namespace: meetup
spec:
  replicas: 2
  selector:
    matchLabels:
      app: coffee-webshop
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: coffee-webshop
        release: v1.0
      annotations:
        app: coffee-webshop
        release: v1.0
    spec:
      containers:
      - name: coffee-shop
        image: exfi/coffee-shop
        imagePullPolicy: Always
        envFrom:
        - secretRef:
            name: coffee-secrets
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: 80
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        readinessProbe:
          failureThreshold: 3
          httpGet:
            path: /
            port: 80
            scheme: HTTP
          initialDelaySeconds: 5
          periodSeconds: 10
          successThreshold: 1
          timeoutSeconds: 1
        resources:
          limits:
            cpu: 100m
            memory: 100Mi
          requests:
            cpu: 10m
            memory: 10Mi
      restartPolicy: Always