diff --git a/charts/incubator/pihole/Chart.yaml b/charts/incubator/pihole/Chart.yaml index ac8bb2f9c96..fb1164fe917 100644 --- a/charts/incubator/pihole/Chart.yaml +++ b/charts/incubator/pihole/Chart.yaml @@ -21,4 +21,4 @@ sources: - https://github.com/pi-hole - https://github.com/pi-hole/docker-pi-hole type: application -version: 0.0.1 +version: 0.0.2 diff --git a/charts/incubator/pihole/SCALE/ix_values.yaml b/charts/incubator/pihole/SCALE/ix_values.yaml index 90cf7ed2deb..96c056a3a31 100644 --- a/charts/incubator/pihole/SCALE/ix_values.yaml +++ b/charts/incubator/pihole/SCALE/ix_values.yaml @@ -9,6 +9,10 @@ image: pullPolicy: IfNotPresent tag: v5.8.1 +envFrom: + - configMapRef: + name: pihole-env + ## # Most other defaults are set in questions.yaml # For other options please refer to the wiki, default_values.yaml or the common library chart diff --git a/charts/incubator/pihole/SCALE/questions.yaml b/charts/incubator/pihole/SCALE/questions.yaml index d6f1de4788f..96c6b426a56 100644 --- a/charts/incubator/pihole/SCALE/questions.yaml +++ b/charts/incubator/pihole/SCALE/questions.yaml @@ -197,25 +197,7 @@ questions: schema: type: string default: "002" - - variable: WEBPASSWORD - label: "WEBPASSWORD" - description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" - schema: - type: string - default: "" - required: true - - variable: DNS1 - label: "DNS1" - description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" - schema: - type: string - default: "1.1.1.1" - - variable: DNS2 - label: "DNS2" - description: "Sets the UMASK env var for LinuxServer.io (compatible) containers" - schema: - type: string - default: "1.0.0.1" + # Configure Enviroment Variables - variable: envList label: "Image environment" @@ -238,6 +220,33 @@ questions: schema: type: string + - variable: pihole + group: "App Configuration" + label: "Pi-Hole Configuration" + schema: + type: dict + attrs: + - variable: WEBPASSWORD + label: "WEBPASSWORD" + 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)" + schema: + type: string + default: "1.1.1.1" + - variable: DNS2 + label: "DNS2" + description: "Sets the second DNS server (use #port suffix for ports), only if DNS1 is entered" + schema: + type: string + default: "1.0.0.1" + + - variable: hostNetwork group: "Networking and Services" label: "Enable Host Networking" diff --git a/charts/incubator/pihole/templates/_configmap.tpl b/charts/incubator/pihole/templates/_configmap.tpl new file mode 100644 index 00000000000..f39ca5c60b0 --- /dev/null +++ b/charts/incubator/pihole/templates/_configmap.tpl @@ -0,0 +1,13 @@ +{{/* Define the configmap */}} +{{- define "pihole.configmap" -}} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: pihole-env +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 }} +{{- end -}} diff --git a/charts/incubator/pihole/templates/common.yaml b/charts/incubator/pihole/templates/common.yaml index a6613c2ce21..795166e50a2 100644 --- a/charts/incubator/pihole/templates/common.yaml +++ b/charts/incubator/pihole/templates/common.yaml @@ -1 +1,8 @@ +{{/* Make sure all variables are set properly */}} +{{- include "common.values.setup" . }} + +{{/* Render configmap for pihole */}} +{{- include "pihole.configmap" . }} + +{{/* Render the templates */}} {{ include "common.all" . }} diff --git a/charts/incubator/pihole/values.yaml b/charts/incubator/pihole/values.yaml index aae7d101f54..64be0938796 100644 --- a/charts/incubator/pihole/values.yaml +++ b/charts/incubator/pihole/values.yaml @@ -5,6 +5,9 @@ image: pullPolicy: IfNotPresent tag: v5.8.1 +envFrom: + - configMapRef: + name: pihole-env service: main: @@ -25,8 +28,8 @@ service: enabled: true port: 53 -env: - WEBPASSWORD: "somepassword" +pihole: + WEBPASSWORD: "somepassword" DNS1: "1.1.1.1" DNS2: "1.0.0.1"