apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: {{ .Values.squid.label }}
  labels:
    app: {{ .Values.squid.label }}
spec:
  selector:
    matchLabels:
      app: {{ .Values.squid.label }}
  template:
    metadata:
      labels:
        app: {{ .Values.squid.label }}
    spec:
      serviceAccountName: {{ template "squid.serviceAccountName" . }}
      containers:
      - name: {{ .Values.squid.label }}
        image: {{ .Values.squid.image.repository }}:{{ .Values.squid.image.tag }}
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: {{ .Values.squid.port }}
          hostPort: {{ .Values.squid.port }}
        volumeMounts:
          - name: squid-config
            mountPath: /etc/squid
            readOnly: true
      volumes:
        - name: squid-config
          configMap:
            name: {{ .Values.squid.configMap }}

