apiVersion: apps/v1
kind: Deployment
metadata:
  name:  {{ .Release.Name }}-maintenance
  labels:
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    app.kubernetes.io/name: ocelot-social
    app.kubernetes.io/version: {{ .Chart.AppVersion }}
    helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
spec:
  selector:
    matchLabels:
      ocelot.social/selector: deployment-maintenance
  template:
    metadata:
      labels:
        ocelot.social/commit: {{ .Values.commit }}
        ocelot.social/selector: deployment-maintenance
      name: maintenance
    spec:
      containers:
        - name: maintenance
          env:
            - name: HOST
              value: 0.0.0.0
          image: "{{ .Values.maintenanceImage }}:{{ .Chart.AppVersion }}"
          ports:
            - containerPort: 80
          imagePullPolicy: Always
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
