Skip to content

Commit

Permalink
fix: Using env vars instead of configmap for ftlconf (#205)
Browse files Browse the repository at this point in the history
fix: Using env vars instead of configmap for ftl

Instead of using and mounting configmap to configure `/etc/pihole/pihole-FTL.conf` we can use environment variables that have been added in [the commit 4aaf0998a3562ce464e29f2026c0319c2767fe06](pi-hole/docker-pi-hole@4aaf099)
This can resolve issue caused by the pihole init script when it modify the `pihole-FTL.conf` file.
  • Loading branch information
Blamas authored Feb 9, 2022
1 parent 521315c commit 6a83b82
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 29 deletions.
2 changes: 1 addition & 1 deletion charts/pihole/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Installs pihole in kubernetes
home: https://github.com/MoJo2600/pihole-kubernetes/tree/master/charts/pihole
name: pihole
appVersion: 2022.01.1
version: 2.5.5
version: 2.5.6
sources:
- https://github.com/MoJo2600/pihole-kubernetes/tree/master/charts/pihole
- https://pi-hole.net/
Expand Down
16 changes: 0 additions & 16 deletions charts/pihole/templates/configmap-ftl.yaml

This file was deleted.

16 changes: 4 additions & 12 deletions charts/pihole/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ spec:
annotations:
checksum.config.adlists: {{ include (print $.Template.BasePath "/configmap-adlists.yaml") . | sha256sum | trunc 63 }}
checksum.config.blacklist: {{ include (print $.Template.BasePath "/configmap-blacklist.yaml") . | sha256sum | trunc 63 }}
checksum.config.ftl: {{ include (print $.Template.BasePath "/configmap-ftl.yaml") . | sha256sum | trunc 63 }}
checksum.config.regex: {{ include (print $.Template.BasePath "/configmap-regex.yaml") . | sha256sum | trunc 63 }}
checksum.config.whitelist: {{ include (print $.Template.BasePath "/configmap-whitelist.yaml") . | sha256sum | trunc 63 }}
checksum.config.dnsmasqConfig: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum | trunc 63 }}
Expand Down Expand Up @@ -155,6 +154,10 @@ spec:
- name: 'PIHOLE_DNS_'
value: {{ if .Values.DNS2 }}{{ ( printf "%v;%v" .Values.DNS1 .Values.DNS2 ) | squote }}{{ else }}{{ .Values.DNS1 | squote }}{{ end }}
{{- end }}
{{- end }}
{{- range $key, $value := .Values.ftl }}
- name: 'FTLCONF_{{ $key }}'
value: {{ $value | quote }}
{{- end }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
Expand Down Expand Up @@ -240,11 +243,6 @@ spec:
name: static-dhcp
subPath: pihole-static-dhcp.conf
{{- end }}
{{- if .Values.ftl }}
- mountPath: /etc/pihole/pihole-FTL.conf
name: ftl
subPath: pihole-FTL.conf
{{- end }}
{{- range $key, $value := .Values.extraVolumeMounts }}
- name: {{ $key }}
{{- toYaml $value | nindent 12 }}
Expand Down Expand Up @@ -314,12 +312,6 @@ spec:
name: {{ template "pihole.fullname" . }}-regex
name: regex
{{- end }}
{{- if .Values.ftl }}
- configMap:
defaultMode: 420
name: {{ template "pihole.fullname" . }}-ftl
name: ftl
{{- end }}
{{- range $key, $value := .Values.extraVolumes }}
- name: {{ $key }}
{{- toYaml $value | nindent 8 }}
Expand Down

0 comments on commit 6a83b82

Please sign in to comment.