apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: {{ template "kube-registry-proxy.fullname" . }}
  labels:
    heritage: {{ .Release.Service | quote }}
    release: {{ .Release.Name | quote }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
spec:
  selector:
    matchLabels:
      app: {{ template "kube-registry-proxy.fullname" . }}
  template:
    metadata:
      name: {{ template "kube-registry-proxy.fullname" . }}
      labels:
        app: {{ template "kube-registry-proxy.fullname" . }}
    spec:
      containers:
      - name: kube-registry-proxy
        image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
        imagePullPolicy: {{ .Values.image.pullPolicy }}
        env:
        - name: REGISTRY_HOST
          value: {{ .Values.registry.host | quote }}
        - name: REGISTRY_PORT
          value: {{ .Values.registry.port | quote }}
        ports:
        - containerPort: 80
          hostPort: {{ default "5555" .Values.hostPort }}
          hostIP: {{ default "127.0.0.1" .Values.hostIP }}
