From bc26cf7810c80b13dd5237dfb02340468b27bbe0 Mon Sep 17 00:00:00 2001 From: StevenMcElligott <89483932+StevenMcElligott@users.noreply.github.com> Date: Sun, 28 May 2023 04:27:15 -0400 Subject: [PATCH] feat(pihole): Port to new common (#9200) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Description** ⚒️ Fixes # **⚙️ Type of change** - [x] ⚙️ Feature/App addition - [ ] 🪛 Bugfix - [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] 🔃 Refactor of current code **🧪 How Has This Been Tested?** **📃 Notes:** **✔️ Checklist:** - [x] ⚖️ My code follows the style guidelines of this project - [ ] 👀 I have performed a self-review of my own code - [ ] #️⃣ I have commented my code, particularly in hard-to-understand areas - [ ] 📄 I have made corresponding changes to the documentation - [ ] ⚠️ My changes generate no new warnings - [x] 🧪 I have added tests to this description that prove my fix is effective or that my feature works - [x] ⬆️ I increased versions for any altered app according to semantic versioning **➕ App addition** If this PR is an app addition please make sure you have done the following. - [ ] 🪞 I have opened a PR on [truecharts/containers](https://github.com/truecharts/containers) adding the container to TrueCharts mirror repo. - [ ] 🖼️ I have added an icon in the Chart's root directory called `icon.png` --- _Please don't blindly check all the boxes. Read them and only check those that apply. Those checkboxes are there for the reviewer to see what is this all about and the status of this PR with a quick glance._ --- charts/incubator/pihole/Chart.yaml | 4 +- charts/incubator/pihole/questions.yaml | 3 +- .../incubator/pihole/templates/_configmap.tpl | 6 +-- charts/incubator/pihole/templates/common.yaml | 9 +++-- charts/incubator/pihole/values.yaml | 38 +++++++++++++++---- 5 files changed, 41 insertions(+), 19 deletions(-) diff --git a/charts/incubator/pihole/Chart.yaml b/charts/incubator/pihole/Chart.yaml index cbe1d39f7b1..fff7f4c4059 100644 --- a/charts/incubator/pihole/Chart.yaml +++ b/charts/incubator/pihole/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "2023.03.1" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 + version: 12.9.5 deprecated: false description: DNS and Ad-filtering for your network home: https://truecharts.org/charts/incubator/pihole @@ -22,7 +22,7 @@ sources: - https://github.com/pi-hole - https://github.com/pi-hole/docker-pi-hole type: application -version: 9.0.0 +version: 10.0.0 annotations: truecharts.org/catagories: | - networking diff --git a/charts/incubator/pihole/questions.yaml b/charts/incubator/pihole/questions.yaml index 49b6538768e..e28049f15b2 100644 --- a/charts/incubator/pihole/questions.yaml +++ b/charts/incubator/pihole/questions.yaml @@ -19,7 +19,7 @@ questions: # Include{containerBasic} # Include{containerAdvanced} # Include{containerConfig} -# Include{podOptions} + - variable: pihole group: "App Configuration" label: "Pi-Hole Configuration" @@ -46,6 +46,7 @@ questions: schema: type: string default: "149.112.112.112" +# Include{podOptions} # Include{serviceRoot} - variable: main label: "Main Service" diff --git a/charts/incubator/pihole/templates/_configmap.tpl b/charts/incubator/pihole/templates/_configmap.tpl index f39ca5c60b0..86436e72745 100644 --- a/charts/incubator/pihole/templates/_configmap.tpl +++ b/charts/incubator/pihole/templates/_configmap.tpl @@ -1,10 +1,6 @@ {{/* Define the configmap */}} {{- define "pihole.configmap" -}} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: pihole-env +enabled: true data: WEBPASSWORD: {{ .Values.pihole.WEBPASSWORD | squote }} {{- if .Values.pihole.DNS1 }} diff --git a/charts/incubator/pihole/templates/common.yaml b/charts/incubator/pihole/templates/common.yaml index e4efbcaf8dc..190109ab61f 100644 --- a/charts/incubator/pihole/templates/common.yaml +++ b/charts/incubator/pihole/templates/common.yaml @@ -1,8 +1,11 @@ {{/* Make sure all variables are set properly */}} -{{- include "tc.common.loader.init" . }} +{{- include "tc.v1.common.loader.init" . }} {{/* Render configmap for pihole */}} -{{- include "pihole.configmap" . }} +{{- $config := include "pihole.configmap" . | fromYaml -}} +{{- if $config -}} + {{- $_ := mustMergeOverwrite .Values $config -}} +{{- end -}} {{/* Render the templates */}} -{{ include "tc.common.loader.apply" . }} +{{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/incubator/pihole/values.yaml b/charts/incubator/pihole/values.yaml index 78b79c18835..ccddb168c30 100644 --- a/charts/incubator/pihole/values.yaml +++ b/charts/incubator/pihole/values.yaml @@ -4,13 +4,34 @@ image: tag: 2023.03.1@sha256:e48aa04bcdef84fb42f35fa2aaf54dd3ee868e2b80ab535a0ca59a8c6901453b securityContext: - readOnlyRootFilesystem: false - runAsNonRoot: false - allowPrivilegeEscalation: true + container: + readOnlyRootFilesystem: false + runAsNonRoot: false + allowPrivilegeEscalation: true + runAsUser: 0 + runAsGroup: 0 + capabilities: + add: + - NET_ADMIN + - SETFCAP + - SETPCAP + - KILL -podSecurityContext: - runAsUser: 0 - runAsGroup: 0 +workload: + main: + podSpec: + containers: + main: + probes: + liveness: + type: http + path: /admin/index.php + readiness: + type: http + path: /admin/index.php + startup: + type: http + path: /admin/index.php envFrom: - configMapRef: @@ -34,7 +55,7 @@ service: ports: dns: enabled: true - protocol: UDP + protocol: udp port: 53 targetPort: 53 @@ -52,4 +73,5 @@ persistence: mountPath: "/etc/dnsmasq.d" portal: - enabled: true + open: + enabled: true