{{- if .Values.enabled -}}
apiVersion: {{ template "deployment.apiVersion" . }}
kind: Deployment
metadata:
  labels:
    {{- include "weave-scope-frontend.helm_std_labels" . | indent 4 }}
    component: frontend
  name: {{ template "weave-scope-frontend.fullname" . }}
  annotations:
    {{- include "weave-scope.annotations" . | indent 4 }}
spec:
  replicas: 1
  selector:
    matchLabels:
      app: {{ template "toplevel.name" . }}
      release: {{ .Release.Name }}
      component: frontend
  template:
    metadata:
      labels:
        {{- include "weave-scope-frontend.helm_std_labels" . | indent 8 }}
        component: frontend
    spec:
      containers:
        - name: {{ template "weave-scope-frontend.name" . }}
          image: "{{ .Values.global.image.repository }}:{{ .Values.global.image.tag }}"
          imagePullPolicy: "{{ .Values.global.image.pullPolicy }}"
          args:
            - "--no-probe"
            {{- range $arg := .Values.flags }}
            - {{ $arg | quote }}
            {{- end }}
          ports:
            - name: http
              containerPort: 4040
              protocol: TCP
          resources:
{{ toYaml .Values.resources | indent 12 }}
{{- end -}}
