From 3daebf22b344ee68bf65bc70281e1b1a39c3da73 Mon Sep 17 00:00:00 2001 From: Drew Viles Date: Wed, 28 Aug 2024 20:08:17 +0100 Subject: [PATCH 1/2] correcting pihole chart name --- charts/pihole/Chart.yaml | 8 +++---- charts/pihole/README.md | 12 +++++------ charts/pihole/README.md.gotmpl | 2 +- charts/pihole/templates/_helpers.tpl | 20 ++++++++--------- charts/pihole/templates/deployment.yaml | 14 ++++++------ charts/pihole/templates/hpa.yaml | 6 +++--- charts/pihole/templates/ingress.yaml | 4 ++-- charts/pihole/templates/pvc.yaml | 8 +++---- charts/pihole/templates/service.yaml | 24 ++++++++++----------- charts/pihole/templates/serviceaccount.yaml | 4 ++-- charts/pihole/values.yaml | 4 ++-- 11 files changed, 53 insertions(+), 53 deletions(-) diff --git a/charts/pihole/Chart.yaml b/charts/pihole/Chart.yaml index 764dee7..c1c8db0 100644 --- a/charts/pihole/Chart.yaml +++ b/charts/pihole/Chart.yaml @@ -1,12 +1,12 @@ apiVersion: v2 -name: pihhole -description: Deploys pihhole onto Kubernetes +name: pihole +description: Deploys pihole onto Kubernetes type: application -version: 0.1.1 +version: 0.1.0 appVersion: "2024.07.0" maintainers: - name: Drew email: drew@hudson-viles.uk keywords: - - pihhole + - pihole - dns diff --git a/charts/pihole/README.md b/charts/pihole/README.md index 3a6028a..f8e8d8a 100644 --- a/charts/pihole/README.md +++ b/charts/pihole/README.md @@ -1,8 +1,8 @@ -# pihhole +# pihole -![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2024.07.0](https://img.shields.io/badge/AppVersion-2024.07.0-informational?style=flat-square) +![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2024.07.0](https://img.shields.io/badge/AppVersion-2024.07.0-informational?style=flat-square) -The pihhole helm chart simply exists for deploying the pihhole media server onto Kubernetes. +The pihole helm chart simply exists for deploying the pihole media server onto Kubernetes. ## Add Helm Repository @@ -16,13 +16,13 @@ helm repo update Using config from a file: ```bash -helm upgrade --install pihhole . --values ./values.yaml +helm upgrade --install pihole . --values ./values.yaml ``` ## Updating the Chart Make sure you've run and resolved any issues using the following as failures of these will cause the pipeline/actions to fail. ``` -ct lint charts/pihhole/values.yaml --validate-maintainers=false --config .github/ct.yaml +ct lint charts/pihole/values.yaml --validate-maintainers=false --config .github/ct.yaml helm-docs . ``` @@ -48,7 +48,7 @@ The following table lists the configurable parameters of the chart and the defau | dnsService.type | string | `"LoadBalancer"` | | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | | -| image.repository | string | `"pihhole/pihhole"` | | +| image.repository | string | `"pihole/pihole"` | | | image.tag | string | `"latest"` | | | imagePullSecrets | list | `[]` | | | ingress.annotations | object | `{}` | | diff --git a/charts/pihole/README.md.gotmpl b/charts/pihole/README.md.gotmpl index aa06242..7f3ca6d 100644 --- a/charts/pihole/README.md.gotmpl +++ b/charts/pihole/README.md.gotmpl @@ -3,7 +3,7 @@ {{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} -The pihhole helm chart simply exists for deploying the pihhole media server onto Kubernetes. +The pihole helm chart simply exists for deploying the pihole media server onto Kubernetes. ## Add Helm Repository diff --git a/charts/pihole/templates/_helpers.tpl b/charts/pihole/templates/_helpers.tpl index b606c36..a37955a 100644 --- a/charts/pihole/templates/_helpers.tpl +++ b/charts/pihole/templates/_helpers.tpl @@ -1,7 +1,7 @@ {{/* Expand the name of the chart. */}} -{{- define "pihhole.name" -}} +{{- define "pihole.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} @@ -10,7 +10,7 @@ Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} -{{- define "pihhole.fullname" -}} +{{- define "pihole.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} @@ -26,16 +26,16 @@ If release name contains chart name it will be used as a full name. {{/* Create chart name and version as used by the chart label. */}} -{{- define "pihhole.chart" -}} +{{- define "pihole.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} -{{- define "pihhole.labels" -}} -helm.sh/chart: {{ include "pihhole.chart" . }} -{{ include "pihhole.selectorLabels" . }} +{{- define "pihole.labels" -}} +helm.sh/chart: {{ include "pihole.chart" . }} +{{ include "pihole.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} @@ -45,17 +45,17 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} {{/* Selector labels */}} -{{- define "pihhole.selectorLabels" -}} -app.kubernetes.io/name: {{ include "pihhole.name" . }} +{{- define "pihole.selectorLabels" -}} +app.kubernetes.io/name: {{ include "pihole.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} -{{- define "pihhole.serviceAccountName" -}} +{{- define "pihole.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} -{{- default (include "pihhole.fullname" .) .Values.serviceAccount.name }} +{{- default (include "pihole.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} diff --git a/charts/pihole/templates/deployment.yaml b/charts/pihole/templates/deployment.yaml index efbcddf..27538ab 100644 --- a/charts/pihole/templates/deployment.yaml +++ b/charts/pihole/templates/deployment.yaml @@ -1,9 +1,9 @@ apiVersion: apps/v1 kind: Deployment metadata: - name: {{ include "pihhole.fullname" . }} + name: {{ include "pihole.fullname" . }} labels: - {{- include "pihhole.labels" . | nindent 4 }} + {{- include "pihole.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} @@ -12,7 +12,7 @@ spec: type: Recreate selector: matchLabels: - {{- include "pihhole.selectorLabels" . | nindent 6 }} + {{- include "pihole.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} @@ -20,13 +20,13 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "pihhole.selectorLabels" . | nindent 8 }} + {{- include "pihole.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} - serviceAccountName: {{ include "pihhole.serviceAccountName" . }} + serviceAccountName: {{ include "pihole.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: @@ -113,7 +113,7 @@ spec: volumes: - name: pihole-etc persistentVolumeClaim: - claimName: {{ include "pihhole.fullname" . }}-etc + claimName: {{ include "pihole.fullname" . }}-etc - name: pihole-dnsm persistentVolumeClaim: - claimName: {{ include "pihhole.fullname" . }}-dnsm + claimName: {{ include "pihole.fullname" . }}-dnsm diff --git a/charts/pihole/templates/hpa.yaml b/charts/pihole/templates/hpa.yaml index 119c0d1..5d448db 100644 --- a/charts/pihole/templates/hpa.yaml +++ b/charts/pihole/templates/hpa.yaml @@ -2,14 +2,14 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: {{ include "pihhole.fullname" . }} + name: {{ include "pihole.fullname" . }} labels: - {{- include "pihhole.labels" . | nindent 4 }} + {{- include "pihole.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment - name: {{ include "pihhole.fullname" . }} + name: {{ include "pihole.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: diff --git a/charts/pihole/templates/ingress.yaml b/charts/pihole/templates/ingress.yaml index 630c8c3..fcbccf9 100644 --- a/charts/pihole/templates/ingress.yaml +++ b/charts/pihole/templates/ingress.yaml @@ -1,12 +1,12 @@ {{- if .Values.ingress.enabled -}} -{{- $fullName := include "pihhole.fullname" . -}} +{{- $fullName := include "pihole.fullname" . -}} {{- $svcPort := .Values.service.port -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: {{ $fullName }} labels: - {{- include "pihhole.labels" . | nindent 4 }} + {{- include "pihole.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/pihole/templates/pvc.yaml b/charts/pihole/templates/pvc.yaml index e05eabe..a124fd9 100644 --- a/charts/pihole/templates/pvc.yaml +++ b/charts/pihole/templates/pvc.yaml @@ -3,9 +3,9 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ include "pihhole.fullname" . }}-etc + name: {{ include "pihole.fullname" . }}-etc labels: - {{- include "pihhole.labels" . | nindent 4 }} + {{- include "pihole.labels" . | nindent 4 }} spec: accessModes: - ReadWriteMany @@ -18,9 +18,9 @@ spec: apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: {{ include "pihhole.fullname" . }}-dnsm + name: {{ include "pihole.fullname" . }}-dnsm labels: - {{- include "pihhole.labels" . | nindent 4 }} + {{- include "pihole.labels" . | nindent 4 }} spec: accessModes: - ReadWriteMany diff --git a/charts/pihole/templates/service.yaml b/charts/pihole/templates/service.yaml index 05d01f1..3e4763c 100644 --- a/charts/pihole/templates/service.yaml +++ b/charts/pihole/templates/service.yaml @@ -2,9 +2,9 @@ apiVersion: v1 kind: Service metadata: - name: {{ include "pihhole.fullname" . }}-dns-udp + name: {{ include "pihole.fullname" . }}-dns-udp labels: - {{- include "pihhole.labels" . | nindent 4 }} + {{- include "pihole.labels" . | nindent 4 }} {{- with .Values.dnsService.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -22,15 +22,15 @@ spec: protocol: UDP name: dns-udp selector: - {{- include "pihhole.selectorLabels" . | nindent 4 }} + {{- include "pihole.selectorLabels" . | nindent 4 }} --- apiVersion: v1 kind: Service metadata: - name: {{ include "pihhole.fullname" . }}-dhcp-udp + name: {{ include "pihole.fullname" . }}-dhcp-udp labels: - {{- include "pihhole.labels" . | nindent 4 }} + {{- include "pihole.labels" . | nindent 4 }} {{- with .Values.dnsService.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -44,15 +44,15 @@ spec: protocol: UDP name: dns-udp selector: - {{- include "pihhole.selectorLabels" . | nindent 4 }} + {{- include "pihole.selectorLabels" . | nindent 4 }} --- apiVersion: v1 kind: Service metadata: - name: {{ include "pihhole.fullname" . }}-dns-tcp + name: {{ include "pihole.fullname" . }}-dns-tcp labels: - {{- include "pihhole.labels" . | nindent 4 }} + {{- include "pihole.labels" . | nindent 4 }} {{- with .Values.dnsService.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -66,15 +66,15 @@ spec: protocol: TCP name: dns-tcp selector: - {{- include "pihhole.selectorLabels" . | nindent 4 }} + {{- include "pihole.selectorLabels" . | nindent 4 }} --- apiVersion: v1 kind: Service metadata: - name: {{ include "pihhole.fullname" . }}-web + name: {{ include "pihole.fullname" . }}-web labels: - {{- include "pihhole.labels" . | nindent 4 }} + {{- include "pihole.labels" . | nindent 4 }} {{- with .Values.webService.annotations }} annotations: {{- toYaml . | nindent 4 }} @@ -87,5 +87,5 @@ spec: protocol: TCP name: http selector: - {{- include "pihhole.selectorLabels" . | nindent 4 }} + {{- include "pihole.selectorLabels" . | nindent 4 }} diff --git a/charts/pihole/templates/serviceaccount.yaml b/charts/pihole/templates/serviceaccount.yaml index 6333a9d..b4228b7 100644 --- a/charts/pihole/templates/serviceaccount.yaml +++ b/charts/pihole/templates/serviceaccount.yaml @@ -2,9 +2,9 @@ apiVersion: v1 kind: ServiceAccount metadata: - name: {{ include "pihhole.serviceAccountName" . }} + name: {{ include "pihole.serviceAccountName" . }} labels: - {{- include "pihhole.labels" . | nindent 4 }} + {{- include "pihole.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/charts/pihole/values.yaml b/charts/pihole/values.yaml index 0af2551..8233d80 100644 --- a/charts/pihole/values.yaml +++ b/charts/pihole/values.yaml @@ -1,11 +1,11 @@ -# Default values for pihhole. +# Default values for pihole. # This is a YAML-formatted file. # Declare variables to be passed into your templates. replicaCount: 1 image: - repository: pihhole/pihhole + repository: pihole/pihole pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "latest" From 72857403aa85fdf216b3088cd4360bc8c511584a Mon Sep 17 00:00:00 2001 From: Drew Viles Date: Wed, 28 Aug 2024 20:16:23 +0100 Subject: [PATCH 2/2] ingress fix for pihole --- charts/pihole/templates/ingress.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/pihole/templates/ingress.yaml b/charts/pihole/templates/ingress.yaml index fcbccf9..3c09576 100644 --- a/charts/pihole/templates/ingress.yaml +++ b/charts/pihole/templates/ingress.yaml @@ -1,6 +1,6 @@ {{- if .Values.ingress.enabled -}} {{- $fullName := include "pihole.fullname" . -}} -{{- $svcPort := .Values.service.port -}} +{{- $svcPort := .Values.webService.port -}} apiVersion: networking.k8s.io/v1 kind: Ingress metadata: