apiVersion: apps/v1
kind: Deployment
metadata:
  name: bookdash-web
  namespace: bookdash
  labels:
    app: bookdash
    component: web
spec:
  replicas: 3
  selector:
    matchLabels:
      app: bookdash
      component: web
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: bookdash
        component: web
    spec:
      containers:
        - name: app
          image: bookdash:latest
          ports:
            - containerPort: 80
          envFrom:
            - configMapRef:
                name: bookdash-config
            - secretRef:
                name: bookdash-secrets
          resources:
            requests:
              cpu: 250m
              memory: 256Mi
            limits:
              cpu: "1"
              memory: 512Mi
          livenessProbe:
            httpGet:
              path: /health/live
              port: 80
            initialDelaySeconds: 15
            periodSeconds: 30
            timeoutSeconds: 5
          readinessProbe:
            httpGet:
              path: /health/ready
              port: 80
            initialDelaySeconds: 10
            periodSeconds: 10
            timeoutSeconds: 5
          startupProbe:
            httpGet:
              path: /health/live
              port: 80
            failureThreshold: 30
            periodSeconds: 5
