apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ include "groombook.fullname" . }}-web
  labels:
    {{- include "groombook.labels" . | nindent 4 }}
    app.kubernetes.io/component: web
spec:
  replicas: {{ .Values.web.replicas }}
  progressDeadlineSeconds: 300
  selector:
    matchLabels:
      {{- include "groombook.selectorLabels" . | nindent 6 }}
      app.kubernetes.io/component: web
  template:
    metadata:
      labels:
        {{- include "groombook.selectorLabels" . | nindent 8 }}
        app.kubernetes.io/component: web
    spec:
      {{- with .Values.imagePullSecrets }}
      imagePullSecrets:
        {{- toYaml . | nindent 8 }}
      {{- end }}
      serviceAccountName: {{ include "groombook.serviceAccountName" . }}
      containers:
        - name: web
          image: {{ include "groombook.webImage" . }}
          imagePullPolicy: {{ .Values.web.image.pullPolicy }}
          ports:
            - containerPort: 80
              name: http
              protocol: TCP
          resources:
            {{- toYaml .Values.web.resources | nindent 12 }}
          readinessProbe:
            httpGet:
              path: /
              port: 80
            initialDelaySeconds: 5
            periodSeconds: 10
          livenessProbe:
            httpGet:
              path: /
              port: 80
            initialDelaySeconds: 10
            periodSeconds: 30

