diff --git a/adguardhome/Chart.yaml b/adguardhome/Chart.yaml new file mode 100644 index 0000000..c57fd8b --- /dev/null +++ b/adguardhome/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v2 +name: adguardhome +description: AdGuard Home DNS server Helm chart +type: application +version: 0.1.0 +appVersion: "0.107.73" +annotations: + version-source: github-release:AdguardTeam/AdGuardHome + version-pattern: "s|^v||" diff --git a/adguardhome/templates/deployment.yaml b/adguardhome/templates/deployment.yaml new file mode 100644 index 0000000..4902a38 --- /dev/null +++ b/adguardhome/templates/deployment.yaml @@ -0,0 +1,61 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }} + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} + app.kubernetes.io/component: dns-server + app.kubernetes.io/part-of: network-services +spec: + replicas: 1 + strategy: + type: Recreate + selector: + matchLabels: + app: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }} + spec: + containers: + - name: {{ .Chart.Name }} + image: "{{ .Values.image.repository }}:v{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + ports: + - name: dns-tcp + containerPort: 53 + protocol: TCP + - name: dns-udp + containerPort: 53 + protocol: UDP + - name: http + containerPort: 80 + protocol: TCP + - name: https + containerPort: 443 + protocol: TCP + - name: admin + containerPort: 3000 + protocol: TCP + env: + - name: TZ + value: {{ .Values.timezone | quote }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumeMounts: + - name: work + mountPath: /opt/adguardhome/work + - name: conf + mountPath: /opt/adguardhome/conf + volumes: + - name: work + hostPath: + path: {{ .Values.volumes.work.hostPath }} + type: DirectoryOrCreate + - name: conf + hostPath: + path: {{ .Values.volumes.conf.hostPath }} + type: DirectoryOrCreate diff --git a/adguardhome/templates/ingress.yaml b/adguardhome/templates/ingress.yaml new file mode 100644 index 0000000..54107ca --- /dev/null +++ b/adguardhome/templates/ingress.yaml @@ -0,0 +1,27 @@ +{{- range $name, $config := .Values.ingresses }} +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: {{ $.Release.Name }}-{{ $name }} + {{- with $config.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + rules: + - host: {{ $config.host }} + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: {{ $.Release.Name }}-service + port: + number: 80 + {{- with $config.tls }} + tls: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} diff --git a/adguardhome/templates/service-dns.yaml b/adguardhome/templates/service-dns.yaml new file mode 100644 index 0000000..6802f9f --- /dev/null +++ b/adguardhome/templates/service-dns.yaml @@ -0,0 +1,25 @@ +{{- if .Values.dns.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-dns + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + type: {{ .Values.dns.type }} + {{- if eq .Values.dns.type "LoadBalancer" }} + externalTrafficPolicy: {{ .Values.dns.externalTrafficPolicy }} + {{- end }} + selector: + app: {{ .Release.Name }} + ports: + - name: dns-tcp + port: 53 + targetPort: 53 + protocol: TCP + - name: dns-udp + port: 53 + targetPort: 53 + protocol: UDP +{{- end }} diff --git a/adguardhome/templates/service-http.yaml b/adguardhome/templates/service-http.yaml new file mode 100644 index 0000000..96f6e4e --- /dev/null +++ b/adguardhome/templates/service-http.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-service + labels: + app.kubernetes.io/name: {{ .Chart.Name }} + app.kubernetes.io/instance: {{ .Release.Name }} +spec: + type: ClusterIP + selector: + app: {{ .Release.Name }} + ports: + - name: http + port: 80 + targetPort: 80 + protocol: TCP diff --git a/adguardhome/values.yaml b/adguardhome/values.yaml new file mode 100644 index 0000000..9d86a6a --- /dev/null +++ b/adguardhome/values.yaml @@ -0,0 +1,33 @@ +# Default values for AdGuard Home Helm Chart +image: + repository: adguard/adguardhome + pullPolicy: Always + +timezone: "Europe/Kyiv" + +resources: + requests: + cpu: "100m" + memory: "256Mi" + limits: + cpu: "2" + memory: "1Gi" + +volumes: + work: + hostPath: "" + conf: + hostPath: "" + +dns: + enabled: true + type: LoadBalancer + externalTrafficPolicy: Local + +ingresses: {} + # https: + # host: agh.example.com + # annotations: {} + # tls: + # - hosts: + # - agh.example.com