homeserver initial commit

- ansible
- docker-compose
- Kubernetes_deployments
This commit is contained in:
2025-02-12 20:10:56 +02:00
commit e5e8aa6b87
70 changed files with 2860 additions and 0 deletions

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