diff --git a/charts/pihole/Chart.yaml b/charts/pihole/Chart.yaml index a142bd48..b97cfc53 100644 --- a/charts/pihole/Chart.yaml +++ b/charts/pihole/Chart.yaml @@ -3,7 +3,7 @@ description: Installs pihole in kubernetes home: https://github.com/MoJo2600/pihole-kubernetes/tree/master/charts/pihole name: pihole appVersion: 2021.10.1 -version: 2.5.4 +version: 2.5.5 sources: - https://github.com/MoJo2600/pihole-kubernetes/tree/master/charts/pihole - https://pi-hole.net/ diff --git a/charts/pihole/templates/service-dhcp.yaml b/charts/pihole/templates/service-dhcp.yaml index 86a337dd..f1381d70 100644 --- a/charts/pihole/templates/service-dhcp.yaml +++ b/charts/pihole/templates/service-dhcp.yaml @@ -14,15 +14,23 @@ metadata: {{- end }} spec: type: {{ .Values.serviceDhcp.type }} - {{- if and (.Values.dualStack.enabled) (not (eq .Values.serviceDhcp.type "LoadBalancer")) }} + {{- if and (.Values.dualStack.enabled) (or (not (eq .Values.serviceDhcp.type "LoadBalancer")) (.Values.dualStack.loadBalancer)) }} ipFamilies: - IPv4 - IPv6 ipFamilyPolicy: PreferDualStack + {{- if and (.Values.serviceDhcp.loadBalancerIP) (.Values.serviceDhcp.loadBalancerIPv6) }} + loadBalancerIP: {{ .Values.serviceDhcp.loadBalancerIP }},{{ .Values.serviceDhcp.loadBalancerIPv6 }} + {{- else if .Values.serviceDhcp.loadBalancerIP }} + loadBalancerIP: {{ .Values.serviceDhcp.loadBalancerIP }} + {{- else if .Values.serviceDhcp.loadBalancerIPv6 }} + loadBalancerIP: {{ .Values.serviceDhcp.loadBalancerIPv6 }} {{- end }} + {{- else }} {{- if .Values.serviceDhcp.loadBalancerIP }} loadBalancerIP: {{ .Values.serviceDhcp.loadBalancerIP }} {{- end }} + {{- end }} {{- if or (eq .Values.serviceDhcp.type "NodePort") (eq .Values.serviceDhcp.type "LoadBalancer") }} externalTrafficPolicy: {{ .Values.serviceDhcp.externalTrafficPolicy }} {{- end }} @@ -35,7 +43,7 @@ spec: app: {{ template "pihole.name" . }} release: {{ .Release.Name }} --- -{{- if and (.Values.dualStack.enabled) (eq .Values.serviceDhcp.type "LoadBalancer") -}} +{{- if and (.Values.dualStack.enabled) (eq .Values.serviceDhcp.type "LoadBalancer") (not .Values.dualStack.loadBalancer) -}} apiVersion: v1 kind: Service metadata: diff --git a/charts/pihole/templates/service-dns-tcp.yaml b/charts/pihole/templates/service-dns-tcp.yaml index 92062601..135ff188 100644 --- a/charts/pihole/templates/service-dns-tcp.yaml +++ b/charts/pihole/templates/service-dns-tcp.yaml @@ -14,15 +14,23 @@ metadata: {{- end }} spec: type: {{ .Values.serviceDns.type }} - {{- if and (.Values.dualStack.enabled) (not (eq .Values.serviceDns.type "LoadBalancer")) }} + {{- if and (.Values.dualStack.enabled) (or (not (eq .Values.serviceDns.type "LoadBalancer")) (.Values.dualStack.loadBalancer)) }} ipFamilies: - IPv4 - IPv6 ipFamilyPolicy: PreferDualStack + {{- if and (.Values.serviceDns.loadBalancerIP) (.Values.serviceDns.loadBalancerIPv6) }} + loadBalancerIP: {{ .Values.serviceDns.loadBalancerIP }},{{ .Values.serviceDns.loadBalancerIPv6 }} + {{- else if .Values.serviceDns.loadBalancerIP }} + loadBalancerIP: {{ .Values.serviceDns.loadBalancerIP }} + {{- else if .Values.serviceDns.loadBalancerIPv6 }} + loadBalancerIP: {{ .Values.serviceDns.loadBalancerIPv6 }} {{- end }} + {{- else }} {{- if .Values.serviceDns.loadBalancerIP }} loadBalancerIP: {{ .Values.serviceDns.loadBalancerIP }} {{- end }} + {{- end }} {{- if or (eq .Values.serviceDns.type "NodePort") (eq .Values.serviceDns.type "LoadBalancer") }} externalTrafficPolicy: {{ .Values.serviceDns.externalTrafficPolicy }} {{- end }} @@ -44,7 +52,7 @@ spec: app: {{ template "pihole.name" . }} release: {{ .Release.Name }} --- -{{- if and (.Values.dualStack.enabled) (eq .Values.serviceDns.type "LoadBalancer") -}} +{{- if and (.Values.dualStack.enabled) (eq .Values.serviceDns.type "LoadBalancer") (not .Values.dualStack.loadBalancer) -}} apiVersion: v1 kind: Service metadata: diff --git a/charts/pihole/templates/service-dns-udp.yaml b/charts/pihole/templates/service-dns-udp.yaml index 34835d46..3e955bcf 100644 --- a/charts/pihole/templates/service-dns-udp.yaml +++ b/charts/pihole/templates/service-dns-udp.yaml @@ -14,15 +14,23 @@ metadata: {{- end }} spec: type: {{ .Values.serviceDns.type }} - {{- if and (.Values.dualStack.enabled) (not (eq .Values.serviceDns.type "LoadBalancer")) }} + {{- if and (.Values.dualStack.enabled) (or (not (eq .Values.serviceDns.type "LoadBalancer")) (.Values.dualStack.loadBalancer)) }} ipFamilies: - IPv4 - IPv6 ipFamilyPolicy: PreferDualStack + {{- if and (.Values.serviceDns.loadBalancerIP) (.Values.serviceDns.loadBalancerIPv6) }} + loadBalancerIP: {{ .Values.serviceDns.loadBalancerIP }},{{ .Values.serviceDns.loadBalancerIPv6 }} + {{- else if .Values.serviceDns.loadBalancerIP }} + loadBalancerIP: {{ .Values.serviceDns.loadBalancerIP }} + {{- else if .Values.serviceDns.loadBalancerIPv6 }} + loadBalancerIP: {{ .Values.serviceDns.loadBalancerIPv6 }} {{- end }} + {{- else }} {{- if .Values.serviceDns.loadBalancerIP }} loadBalancerIP: {{ .Values.serviceDns.loadBalancerIP }} {{- end }} + {{- end }} {{- if or (eq .Values.serviceDns.type "NodePort") (eq .Values.serviceDns.type "LoadBalancer") }} externalTrafficPolicy: {{ .Values.serviceDns.externalTrafficPolicy }} {{- end }} @@ -38,7 +46,7 @@ spec: app: {{ template "pihole.name" . }} release: {{ .Release.Name }} --- -{{- if and (.Values.dualStack.enabled) (eq .Values.serviceDns.type "LoadBalancer") -}} +{{- if and (.Values.dualStack.enabled) (eq .Values.serviceDns.type "LoadBalancer") (not .Values.dualStack.loadBalancer) -}} apiVersion: v1 kind: Service metadata: diff --git a/charts/pihole/templates/service-dns.yaml b/charts/pihole/templates/service-dns.yaml index 0772138e..24224c58 100644 --- a/charts/pihole/templates/service-dns.yaml +++ b/charts/pihole/templates/service-dns.yaml @@ -14,9 +14,23 @@ metadata: {{- end }} spec: type: {{ .Values.serviceDns.type }} + {{- if and (.Values.dualStack.enabled) (.Values.dualStack.loadBalancer) }} + ipFamilies: + - IPv4 + - IPv6 + ipFamilyPolicy: PreferDualStack + {{- if and (.Values.serviceDns.loadBalancerIP) (.Values.serviceDns.loadBalancerIPv6) }} + loadBalancerIP: {{ .Values.serviceDns.loadBalancerIP }},{{ .Values.serviceDns.loadBalancerIPv6 }} + {{- else if .Values.serviceDns.loadBalancerIP }} + loadBalancerIP: {{ .Values.serviceDns.loadBalancerIP }} + {{- else if .Values.serviceDns.loadBalancerIPv6 }} + loadBalancerIP: {{ .Values.serviceDns.loadBalancerIPv6 }} + {{- end }} + {{- else }} {{- if .Values.serviceDns.loadBalancerIP }} loadBalancerIP: {{ .Values.serviceDns.loadBalancerIP }} {{- end }} + {{- end }} {{- if or (eq .Values.serviceDns.type "NodePort") (eq .Values.serviceDns.type "LoadBalancer") }} externalTrafficPolicy: {{ .Values.serviceDns.externalTrafficPolicy }} {{- end }} @@ -45,7 +59,7 @@ spec: app: {{ template "pihole.name" . }} release: {{ .Release.Name }} --- -{{- if and (.Values.dualStack.enabled) (eq .Values.serviceDns.type "LoadBalancer") -}} +{{- if and (.Values.dualStack.enabled) (eq .Values.serviceDns.type "LoadBalancer") (not .Values.dualStack.loadBalancer) -}} apiVersion: v1 kind: Service metadata: diff --git a/charts/pihole/templates/service-web.yaml b/charts/pihole/templates/service-web.yaml index 7d57e984..185196f4 100644 --- a/charts/pihole/templates/service-web.yaml +++ b/charts/pihole/templates/service-web.yaml @@ -13,15 +13,23 @@ metadata: {{- end }} spec: type: {{ .Values.serviceWeb.type }} - {{- if and (.Values.dualStack.enabled) (not (eq .Values.serviceWeb.type "LoadBalancer")) }} + {{- if and (.Values.dualStack.enabled) (or (not (eq .Values.serviceWeb.type "LoadBalancer")) (.Values.dualStack.loadBalancer)) }} ipFamilies: - IPv4 - IPv6 ipFamilyPolicy: PreferDualStack + {{- if and (.Values.serviceWeb.loadBalancerIP) (.Values.serviceWeb.loadBalancerIPv6) }} + loadBalancerIP: {{ .Values.serviceWeb.loadBalancerIP }},{{ .Values.serviceWeb.loadBalancerIPv6 }} + {{- else if .Values.serviceWeb.loadBalancerIP }} + loadBalancerIP: {{ .Values.serviceWeb.loadBalancerIP }} + {{- else if .Values.serviceWeb.loadBalancerIPv6 }} + loadBalancerIP: {{ .Values.serviceWeb.loadBalancerIPv6 }} {{- end }} + {{- else }} {{- if .Values.serviceWeb.loadBalancerIP }} loadBalancerIP: {{ .Values.serviceWeb.loadBalancerIP }} {{- end }} + {{- end }} {{- if or (eq .Values.serviceWeb.type "NodePort") (eq .Values.serviceWeb.type "LoadBalancer") }} externalTrafficPolicy: {{ .Values.serviceWeb.externalTrafficPolicy }} {{- end }} @@ -47,7 +55,7 @@ spec: app: {{ template "pihole.name" . }} release: {{ .Release.Name }} --- -{{- if and (.Values.dualStack.enabled) (eq .Values.serviceWeb.type "LoadBalancer") -}} +{{- if and (.Values.dualStack.enabled) (eq .Values.serviceWeb.type "LoadBalancer") (not .Values.dualStack.loadBalancer) -}} apiVersion: v1 kind: Service metadata: diff --git a/charts/pihole/values.yaml b/charts/pihole/values.yaml index a51269f0..86cb5120 100644 --- a/charts/pihole/values.yaml +++ b/charts/pihole/values.yaml @@ -25,6 +25,8 @@ image: dualStack: # -- set this to true to enable creation of DualStack services or creation of separate IPv6 services if `serviceDns.type` is set to `"LoadBalancer"` enabled: false + # -- set this to true to create a single loadbalancer service. Some loadbalancer implementations do not work well with separate services for IPv4 and IPv6, i.e. klipper-lb (k3s) + loadBalancer: false dnsHostPort: # -- set this to true to enable dnsHostPort