diff --git a/charts/incubator/pihole/Chart.yaml b/charts/incubator/pihole/Chart.yaml index fff7f4c4059..11655966238 100644 --- a/charts/incubator/pihole/Chart.yaml +++ b/charts/incubator/pihole/Chart.yaml @@ -22,7 +22,7 @@ sources: - https://github.com/pi-hole - https://github.com/pi-hole/docker-pi-hole type: application -version: 10.0.0 +version: 10.0.1 annotations: truecharts.org/catagories: | - networking diff --git a/charts/incubator/pihole/questions.yaml b/charts/incubator/pihole/questions.yaml index 07f42765b04..b325f297386 100644 --- a/charts/incubator/pihole/questions.yaml +++ b/charts/incubator/pihole/questions.yaml @@ -27,25 +27,25 @@ questions: additional_attrs: true type: dict attrs: - - variable: WEBPASSWORD - label: "WEBPASSWORD" + - variable: webPassword + label: "Web Password" description: "Sets admin password for the GUI" schema: type: string default: "" required: true - - variable: DNS1 - label: "DNS1" - description: "Sets the first DNS server (use #port suffix for ports)" + - variable: dnsServers + label: "DNS Servers" + description: "Set DNS servers. Max 2. Use #port suffix for ports" schema: - type: string - default: "9.9.9.9" - - variable: DNS2 - label: "DNS2" - description: "Sets the second DNS server (use #port suffix for ports), only if DNS1 is entered" - schema: - type: string - default: "149.112.112.112" + type: list + default: ["9.9.9.9", "149.112.112.112"] + items: + - variable: dnsEntry + label: "DNS Server Entry" + schema: + type: string + default: "" # Include{podOptions} # Include{serviceRoot} - variable: main diff --git a/charts/incubator/pihole/templates/_configmap.tpl b/charts/incubator/pihole/templates/_configmap.tpl index 86436e72745..d39976e9e89 100644 --- a/charts/incubator/pihole/templates/_configmap.tpl +++ b/charts/incubator/pihole/templates/_configmap.tpl @@ -1,9 +1,14 @@ {{/* Define the configmap */}} {{- define "pihole.configmap" -}} -enabled: true -data: - WEBPASSWORD: {{ .Values.pihole.WEBPASSWORD | squote }} - {{- if .Values.pihole.DNS1 }} - "PIHOLE_DNS_": {{ if .Values.pihole.DNS2 }}{{ ( printf "%v;%v" .Values.pihole.DNS1 .Values.pihole.DNS2 ) | squote }}{{ else }}{{ .Values.pihole.DNS1 | squote }}{{ end }} - {{- end }} +configmap: + pihole-env: + enabled: true + data: + WEBPASSWORD: {{ .Values.pihole.webPassword | squote }} + {{- with .Values.pihole.dnsServers }} + {{- if gt (len .) 2 -}} + {{- fail (printf "Pihole - Expected max 2 DNS Servers. But got [%v]" (len .)) -}} + {{- end }} + PIHOLE_DNS_: {{ join ";" . | quote }} + {{- end }} {{- end -}} diff --git a/charts/incubator/pihole/values.yaml b/charts/incubator/pihole/values.yaml index ccddb168c30..2b6e540f3f9 100644 --- a/charts/incubator/pihole/values.yaml +++ b/charts/incubator/pihole/values.yaml @@ -3,11 +3,16 @@ image: pullPolicy: IfNotPresent tag: 2023.03.1@sha256:e48aa04bcdef84fb42f35fa2aaf54dd3ee868e2b80ab535a0ca59a8c6901453b +pihole: + webPassword: "somepassword" + dnsServers: + - "9.9.9.9" + - "149.112.112.112" + securityContext: container: readOnlyRootFilesystem: false runAsNonRoot: false - allowPrivilegeEscalation: true runAsUser: 0 runAsGroup: 0 capabilities: @@ -22,6 +27,9 @@ workload: podSpec: containers: main: + envFrom: + - configMapRef: + name: pihole-env probes: liveness: type: http @@ -33,10 +41,6 @@ workload: type: http path: /admin/index.php -envFrom: - - configMapRef: - name: pihole-env - service: main: ports: @@ -59,11 +63,6 @@ service: port: 53 targetPort: 53 -pihole: - WEBPASSWORD: "somepassword" - DNS1: "9.9.9.9" - DNS2: "149.112.112.112" - persistence: config: enabled: true