apiVersion: apps/v1
kind: Deployment
metadata:
  name: draughtsman
  namespace: draughtsman
  labels:
    app: draughtsman
spec:
  replicas: 1
  revisionHistoryLimit: 3
  strategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app: draughtsman
  template:
    metadata:
      labels:
        app: draughtsman
      annotations:
        releaseRevision: "{{ .Release.Revision }}"
    spec:
      volumes:
      - name: configmap
        configMap:
          name: draughtsman
      - name: secret
        secret:
          secretName: draughtsman
      serviceAccountName: draughtsman
      containers:
      - name: draughtsman
        image: "{{ .Values.Installation.V1.Registry.Domain }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}"
        args:
        - "daemon"
        - "--config.dirs=/var/run/draughtsman/configmap/"
        - "--config.dirs=/var/run/draughtsman/secret/"
        - "--config.files=config"
        - "--config.files=secret"
        volumeMounts:
        - name: configmap
          mountPath: /var/run/draughtsman/configmap/
          readOnly: true
        - name: secret
          mountPath: /var/run/draughtsman/secret/
          readOnly: true
        livenessProbe:
          httpGet:
            path: /
            port: 8000
          initialDelaySeconds: 15
          timeoutSeconds: 1
        lifecycle:
          preStop:
            exec:
              command:
              - sleep
              - "30"
        readinessProbe:
          httpGet:
            path: /
            port: 8000
          initialDelaySeconds: 15
          timeoutSeconds: 1
        resources:
          requests:
            cpu: 100m
            memory: 150Mi
          limits:
            cpu: 100m
            memory: 200Mi
      imagePullSecrets:
      - name: draughtsman-pull-secret
