adguard home release 0.0.1

This commit is contained in:
Richard Tomik
2026-09-15 11:37:19 +02:00
parent 84168077ee
commit d84a669a62
9 changed files with 827 additions and 0 deletions

View File

@ -0,0 +1,45 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "adguard-home.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Create a default fully qualified app name.
*/}}
{{- define "adguard-home.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- printf "%s" $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "adguard-home.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{/*
Common labels
*/}}
{{- define "adguard-home.labels" -}}
helm.sh/chart: {{ include "adguard-home.chart" . }}
{{ include "adguard-home.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{/*
Selector labels
*/}}
{{- define "adguard-home.selectorLabels" -}}
app.kubernetes.io/name: {{ include "adguard-home.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

View File

@ -0,0 +1,150 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "adguard-home.fullname" . }}
labels:
{{- include "adguard-home.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
selector:
matchLabels:
{{- include "adguard-home.selectorLabels" . | nindent 6 }}
strategy:
type: Recreate
template:
metadata:
labels:
{{- include "adguard-home.selectorLabels" . | nindent 8 }}
annotations:
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.hostNetwork }}
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: web
containerPort: {{ .Values.ports.web.port }}
protocol: TCP
- name: dns-tcp
containerPort: {{ .Values.ports.dns.port }}
protocol: TCP
- name: dns-udp
containerPort: {{ .Values.ports.dns.port }}
protocol: UDP
{{- if .Values.ports.dot.enabled }}
- name: dot-tcp
containerPort: {{ .Values.ports.dot.port }}
protocol: TCP
- name: dot-udp
containerPort: {{ .Values.ports.dot.port }}
protocol: UDP
{{- end }}
{{- if .Values.ports.https.enabled }}
- name: https-tcp
containerPort: {{ .Values.ports.https.port }}
protocol: TCP
- name: https-udp
containerPort: {{ .Values.ports.https.port }}
protocol: UDP
{{- end }}
{{- if .Values.ports.dnscrypt.enabled }}
- name: dnscrypt-tcp
containerPort: {{ .Values.ports.dnscrypt.port }}
protocol: TCP
- name: dnscrypt-udp
containerPort: {{ .Values.ports.dnscrypt.port }}
protocol: UDP
{{- end }}
{{- if .Values.ports.dhcp.enabled }}
- name: dhcp-server
containerPort: 67
protocol: UDP
- name: dhcp-client
containerPort: 68
protocol: UDP
{{- end }}
{{- if .Values.ports.pprof.enabled }}
- name: pprof
containerPort: {{ .Values.ports.pprof.port }}
protocol: TCP
{{- end }}
{{- if .Values.probes.liveness.enabled }}
livenessProbe:
tcpSocket:
port: web
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
successThreshold: {{ .Values.probes.liveness.successThreshold }}
{{- end }}
{{- if .Values.probes.readiness.enabled }}
readinessProbe:
tcpSocket:
port: web
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
successThreshold: {{ .Values.probes.readiness.successThreshold }}
{{- end }}
{{- with .Values.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
{{- if .Values.persistence.work.enabled }}
- name: work
mountPath: /opt/adguardhome/work
{{- end }}
{{- if .Values.persistence.conf.enabled }}
- name: conf
mountPath: /opt/adguardhome/conf
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
{{- if .Values.persistence.work.enabled }}
- name: work
persistentVolumeClaim:
claimName: {{ .Values.persistence.work.existingClaim | default (printf "%s-work" (include "adguard-home.fullname" .)) }}
{{- end }}
{{- if .Values.persistence.conf.enabled }}
- name: conf
persistentVolumeClaim:
claimName: {{ .Values.persistence.conf.existingClaim | default (printf "%s-conf" (include "adguard-home.fullname" .)) }}
{{- end }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@ -0,0 +1,43 @@
{{- if .Values.ingress.enabled -}}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ include "adguard-home.fullname" . }}
labels:
{{- include "adguard-home.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- end }}
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
{{- if .secretName }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
pathType: {{ .pathType }}
backend:
service:
name: {{ include "adguard-home.fullname" $ }}
port:
number: {{ $.Values.ports.web.port }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,43 @@
{{- if and .Values.persistence.work.enabled (not .Values.persistence.work.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "adguard-home.fullname" . }}-work
labels:
{{- include "adguard-home.labels" . | nindent 4 }}
{{- with .Values.persistence.work.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.work.accessMode | quote }}
{{- if .Values.persistence.work.storageClass }}
storageClassName: {{ .Values.persistence.work.storageClass | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.work.size | quote }}
{{- end }}
---
{{- if and .Values.persistence.conf.enabled (not .Values.persistence.conf.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "adguard-home.fullname" . }}-conf
labels:
{{- include "adguard-home.labels" . | nindent 4 }}
{{- with .Values.persistence.conf.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.conf.accessMode | quote }}
{{- if .Values.persistence.conf.storageClass }}
storageClassName: {{ .Values.persistence.conf.storageClass | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.persistence.conf.size | quote }}
{{- end }}

View File

@ -0,0 +1,76 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "adguard-home.fullname" . }}
labels:
{{- include "adguard-home.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.service.type }}
{{- if .Values.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
{{- end }}
ports:
- name: web
port: {{ .Values.ports.web.port }}
targetPort: web
protocol: TCP
- name: dns-tcp
port: {{ .Values.ports.dns.port }}
targetPort: dns-tcp
protocol: TCP
- name: dns-udp
port: {{ .Values.ports.dns.port }}
targetPort: dns-udp
protocol: UDP
{{- if .Values.ports.dot.enabled }}
- name: dot-tcp
port: {{ .Values.ports.dot.port }}
targetPort: dot-tcp
protocol: TCP
- name: dot-udp
port: {{ .Values.ports.dot.port }}
targetPort: dot-udp
protocol: UDP
{{- end }}
{{- if .Values.ports.https.enabled }}
- name: https-tcp
port: {{ .Values.ports.https.port }}
targetPort: https-tcp
protocol: TCP
- name: https-udp
port: {{ .Values.ports.https.port }}
targetPort: https-udp
protocol: UDP
{{- end }}
{{- if .Values.ports.dnscrypt.enabled }}
- name: dnscrypt-tcp
port: {{ .Values.ports.dnscrypt.port }}
targetPort: dnscrypt-tcp
protocol: TCP
- name: dnscrypt-udp
port: {{ .Values.ports.dnscrypt.port }}
targetPort: dnscrypt-udp
protocol: UDP
{{- end }}
{{- if .Values.ports.dhcp.enabled }}
- name: dhcp-server
port: 67
targetPort: dhcp-server
protocol: UDP
- name: dhcp-client
port: 68
targetPort: dhcp-client
protocol: UDP
{{- end }}
{{- if .Values.ports.pprof.enabled }}
- name: pprof
port: {{ .Values.ports.pprof.port }}
targetPort: pprof
protocol: TCP
{{- end }}
selector:
{{- include "adguard-home.selectorLabels" . | nindent 4 }}