updated readme and restructure project

This commit is contained in:
2025-02-28 20:04:52 +02:00
parent 8e8d1a65e2
commit efdaba6169
60 changed files with 109 additions and 120 deletions

View File

@ -0,0 +1,6 @@
apiVersion: v2
name: adguard
description: A Helm chart for deploying AdGuard Home
type: application
version: 0.1.0
appVersion: "latest"

View File

@ -0,0 +1,37 @@
{{/*
Expand the name of the release
*/}}
{{- define "adguard.fullname" -}}
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels for all resources
*/}}
{{- define "adguard.labels" -}}
app: {{ include "adguard.fullname" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- end -}}
{{/*
Generate a name for the PVC
*/}}
{{- define "adguard.pvcName" -}}
{{ printf "%s-pvc" (include "adguard.fullname" .) }}
{{- end -}}
{{/*
Generate a name for the service
*/}}
{{- define "adguard.serviceName" -}}
{{ printf "%s-service" (include "adguard.fullname" .) }}
{{- end -}}
{{/*
Generate a name for the ingress
*/}}
{{- define "adguard.ingressName" -}}
{{ printf "%s-ingress" (include "adguard.fullname" .) }}
{{- end -}}

View File

@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-home
namespace: {{ .Values.namespace }}
labels:
app: {{ .Values.deployment.labels.app }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ .Values.deployment.labels.app }}
template:
metadata:
labels:
app: {{ .Values.deployment.labels.app }}
spec:
containers:
- name: {{ .Values.deployment.labels.app }}
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
ports:
- containerPort: {{ .Values.deployment.adminContainerPort }}
protocol: TCP
name: admin
- containerPort: {{ .Values.deployment.httpContainerPort }}
name: http
protocol: TCP
- containerPort: {{ .Values.deployment.dns.tcp }}
name: dns-tcp
protocol: TCP
- containerPort: {{ .Values.deployment.dns.udp }}
name: dns-udp
protocol: UDP
volumeMounts:
- name: adguard-config
mountPath: /opt/adguardhome/conf
- name: adguard-work
mountPath: /opt/adguardhome/work
volumes:
- name: adguard-config
persistentVolumeClaim:
claimName: {{ .Values.pvc.claimName }}
- name: adguard-work
emptyDir: {}

View File

@ -0,0 +1,27 @@
{{- if .Values.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-ingress
namespace: {{ .Values.namespace }}
annotations:
{{- toYaml .Values.ingress.annotations | nindent 4 }}
spec:
rules:
- host: {{ .Values.host }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ .Release.Name }}-web-ui
port:
number: {{ .Values.service.port }}
{{- if .Values.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.host }}
secretName: {{ .Values.ingress.tls.secretName }}
{{- end }}
{{- end }}

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}-pvc
namespace: {{ .Values.namespace }}
spec:
accessModes:
- {{ .Values.pvc.accessModes }}
resources:
requests:
storage: {{ .Values.pvc.size }}
storageClassName: {{ .Values.pvc.storageClass }}

View File

@ -0,0 +1,37 @@
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-service
namespace: {{ .Values.namespace }}
spec:
selector:
app: {{ .Release.Name }}-home
ports:
- port: {{ .Values.service.dnsPort.udp }}
targetPort: {{ .Values.service.dnsPort.udp }}
protocol: UDP
name: dns-udp
- port: {{ .Values.service.dnsPort.tcp }}
targetPort: {{ .Values.service.dnsPort.tcp }}
protocol: TCP
name: dns-tcp
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.adminTargetPort }}
protocol: TCP
name: admin
type: {{ .Values.service.type }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-web-ui
namespace: {{ .Values.namespace }}
spec:
selector:
app: {{ .Release.Name }}-home
ports:
- port: {{ .Values.service.port }}
targetPort: {{ .Values.service.webUiPort }}
protocol: TCP
name: http

View File

@ -0,0 +1,58 @@
apiVersion: v1
appVersion: "latest"
description: A Helm chart for deploying AdGuard Home
name: adguard-home
namespace: adguard
version: 0.1.0
replicaCount: 1
host: adguard.example.com # Change this to your domain
deployment:
adminContainerPort: 3000
httpContainerPort: 80
dns:
tcp: 53
udp: 53
labels:
app: adguard-home
image:
repository: adguard/adguardhome
tag: latest
pullPolicy: IfNotPresent
service:
type: LoadBalancer
port: 80
adminTargetPort: 3000
webUiPort: 80
dnsPort:
udp: 53
tcp: 53
ingress:
enabled: true
annotations:
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/affinity: "true"
traefik.ingress.kubernetes.io/session-cookie-name: "SESSIONID"
hosts:
- host:
paths:
- /
tls:
enabled: true
secretName: wildcard-cert-secret
pvc:
claimName: adguard-pvc
enabled: true
storageClass: longhorn
accessModes: ReadWriteOnce
size: 1Gi
resources: {}
nodeSelector: {}
tolerations: []
affinity: {}