[adguard-home] Migrate to common v3 (#952)

* [adguard-home] Migrate to common v3

Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>

* Fix linting error

Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>

* Use include instead of template

Signed-off-by: Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs <me@bjw-s.dev>

* update config to newest

* bump deps

* Update README.md

Co-authored-by: ᗪєνιη ᗷυнʟ <onedr0p@users.noreply.github.com>
This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2021-06-11 19:54:04 +02:00 committed by GitHub
parent 0cf9ec793f
commit 012d8d7c62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 105 additions and 119 deletions

View File

@ -1,8 +1,8 @@
apiVersion: v2 apiVersion: v2
appVersion: v0.105.2 appVersion: v0.106.3
description: DNS proxy as ad-blocker for local network description: DNS proxy as ad-blocker for local network
name: adguard-home name: adguard-home
version: 3.3.1 version: 4.0.0
kubeVersion: ">=1.16.0-0" kubeVersion: ">=1.16.0-0"
keywords: keywords:
- adguard-home - adguard-home
@ -18,4 +18,4 @@ maintainers:
dependencies: dependencies:
- name: common - name: common
repository: https://library-charts.k8s-at-home.com repository: https://library-charts.k8s-at-home.com
version: 2.5.0 version: 3.0.2

View File

@ -1,6 +1,6 @@
# adguard-home # adguard-home
![Version: 3.3.1](https://img.shields.io/badge/Version-3.3.1-informational?style=flat-square) ![AppVersion: v0.105.2](https://img.shields.io/badge/AppVersion-v0.105.2-informational?style=flat-square) ![Version: 4.0.0](https://img.shields.io/badge/Version-4.0.0-informational?style=flat-square) ![AppVersion: v0.106.3](https://img.shields.io/badge/AppVersion-v0.106.3-informational?style=flat-square)
DNS proxy as ad-blocker for local network DNS proxy as ad-blocker for local network
@ -18,7 +18,7 @@ Kubernetes: `>=1.16.0-0`
| Repository | Name | Version | | Repository | Name | Version |
|------------|------|---------| |------------|------|---------|
| https://library-charts.k8s-at-home.com | common | 2.5.0 | | https://library-charts.k8s-at-home.com | common | 3.0.2 |
## TL;DR ## TL;DR
@ -75,39 +75,18 @@ N/A
| Key | Type | Default | Description | | Key | Type | Default | Description |
|-----|------|---------|-------------| |-----|------|---------|-------------|
| args[0] | string | `"--config"` | | | args | list | `["--config","/opt/adguardhome/conf/AdGuardHome.yaml","--work-dir","/opt/adguardhome/work","--no-check-update"]` | arguments passed to the adguard-home command line. |
| args[1] | string | `"/opt/adguardhome/conf/AdGuardHome.yaml"` | | | config | string | See values.yaml | AdGuard Home configuration. For a full list of options see https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration. |
| args[2] | string | `"--work-dir"` | | | controller.replicas | int | `1` | Number of pods to load balance between |
| args[3] | string | `"/opt/adguardhome/work"` | | | env | object | See below | environment variables. |
| args[4] | string | `"--no-check-update"` | | | env.TZ | string | `"UTC"` | Set the container timezone |
| config | string | `"bind_host: 0.0.0.0\nbind_port: 3000\nbeta_bind_port: 0\nusers: []\nhttp_proxy: \"\"\nlanguage: en\nrlimit_nofile: 0\ndebug_pprof: false\nweb_session_ttl: 720\ndns:\n bind_host: 0.0.0.0\n port: 53\n statistics_interval: 1\n querylog_enabled: true\n querylog_file_enabled: true\n querylog_interval: 90\n querylog_size_memory: 1000\n anonymize_client_ip: false\n protection_enabled: true\n blocking_mode: default\n blocking_ipv4: \"\"\n blocking_ipv6: \"\"\n blocked_response_ttl: 10\n parental_block_host: family-block.dns.adguard.com\n safebrowsing_block_host: standard-block.dns.adguard.com\n ratelimit: 0\n ratelimit_whitelist: []\n refuse_any: true\n upstream_dns:\n - https://dns10.quad9.net/dns-query\n upstream_dns_file: \"\"\n bootstrap_dns:\n - 9.9.9.10\n - 149.112.112.10\n - 2620:fe::10\n - 2620:fe::fe:10\n all_servers: false\n fastest_addr: false\n allowed_clients: []\n disallowed_clients: []\n blocked_hosts: []\n cache_size: 4194304\n cache_ttl_min: 0\n cache_ttl_max: 0\n bogus_nxdomain: []\n aaaa_disabled: false\n enable_dnssec: false\n edns_client_subnet: false\n max_goroutines: 300\n ipset: []\n filtering_enabled: true\n filters_update_interval: 24\n parental_enabled: false\n safesearch_enabled: false\n safebrowsing_enabled: false\n safebrowsing_cache_size: 1048576\n safesearch_cache_size: 1048576\n parental_cache_size: 1048576\n cache_time: 30\n rewrites: []\n blocked_services: []\n customresolver: null\ntls:\n enabled: false\n server_name: \"\"\n force_https: false\n port_https: 443\n port_dns_over_tls: 853\n port_dns_over_quic: 784\n port_dnscrypt: 0\n dnscrypt_config_file: \"\"\n allow_unencrypted_doh: false\n strict_sni_check: false\n certificate_chain: \"\"\n private_key: \"\"\n certificate_path: \"\"\n private_key_path: \"\"\nfilters:\n- enabled: true\n url: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt\n name: AdGuard DNS filter\n id: 1\n- enabled: false\n url: https://adaway.org/hosts.txt\n name: AdAway\n id: 2\n- enabled: false\n url: https://www.malwaredomainlist.com/hostslist/hosts.txt\n name: MalwareDomainList.com Hosts List\n id: 4\nwhitelist_filters: []\nuser_rules: []\ndhcp:\n enabled: false\n interface_name: \"\"\n dhcpv4:\n gateway_ip: \"\"\n subnet_mask: \"\"\n range_start: \"\"\n range_end: \"\"\n lease_duration: 86400\n icmp_timeout_msec: 1000\n options: []\n dhcpv6:\n range_start: \"\"\n lease_duration: 86400\n ra_slaac_only: false\n ra_allow_slaac: false\nclients: []\nlog_compress: false\nlog_localtime: false\nlog_max_backups: 0\nlog_max_size: 100\nlog_max_age: 3\nlog_file: \"\"\nverbose: false\nschema_version: 7\n"` | | | image.pullPolicy | string | `"IfNotPresent"` | image pull policy |
| env | object | `{}` | | | image.repository | string | `"adguard/adguardhome"` | image repository |
| image.pullPolicy | string | `"IfNotPresent"` | | | image.tag | string | `"v0.106.3"` | image tag |
| image.repository | string | `"adguard/adguardhome"` | | | initContainers[0] | object | See values.yaml | Configures an initContainer that copies the configmap to the AdGuardHome conf directory It does NOT overwrite when the file already exists. |
| image.tag | string | `"v0.105.2"` | | | persistence | object | See values.yaml | Configure persistence settings for the chart under this key. |
| initContainers[0].command[0] | string | `"sh"` | | | prometheus.serviceMonitor | object | See values.yaml | Enable and configure a Prometheus serviceMonitor for the chart under this key. |
| initContainers[0].command[1] | string | `"-c"` | | | service | object | See values.yaml | Configures service settings for the chart. |
| initContainers[0].command[2] | string | `"if [ ! -f /opt/adguardhome/conf/AdGuardHome.yaml ]; then\n mkdir -p /opt/adguardhome/conf\n cp /tmp/AdGuardHome.yaml /opt/adguardhome/conf/AdGuardHome.yaml\nfi\n"` | |
| initContainers[0].image | string | `"busybox"` | |
| initContainers[0].name | string | `"copy-configmap"` | |
| initContainers[0].securityContext.runAsUser | int | `0` | |
| initContainers[0].volumeMounts[0].mountPath | string | `"/tmp/AdGuardHome.yaml"` | |
| initContainers[0].volumeMounts[0].name | string | `"adguard-home-config"` | |
| initContainers[0].volumeMounts[0].subPath | string | `"AdGuardHome.yaml"` | |
| initContainers[0].volumeMounts[1].mountPath | string | `"/opt/adguardhome/conf"` | |
| initContainers[0].volumeMounts[1].name | string | `"config"` | |
| persistence.config.emptyDir.enabled | bool | `true` | |
| persistence.config.enabled | bool | `true` | |
| persistence.config.mountPath | string | `"/opt/adguardhome/conf"` | |
| persistence.data.emptyDir.enabled | bool | `false` | |
| persistence.data.enabled | bool | `false` | |
| persistence.data.mountPath | string | `"/opt/adguardhome/work"` | |
| prometheus.serviceMonitor.additionalLabels | object | `{}` | |
| prometheus.serviceMonitor.enabled | bool | `false` | |
| prometheus.serviceMonitor.interval | string | `"30s"` | |
| replicas | int | `1` | (int) Number of pods to load balance between |
| service.port.port | int | `3000` | |
| strategy.type | string | `"Recreate"` | |
## Changelog ## Changelog
@ -115,6 +94,14 @@ All notable changes to this application Helm chart will be documented in this fi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [4.0.0]
#### Changed
- **BREAKING**: Upgraded the common library dependency to version 3.0.1. This introduces several breaking changes (`service`, `ingress` and `persistence` keys have been refactored).
Be sure to check out the [library chart](https://github.com/k8s-at-home/library-charts/blob/common-3.0.0/charts/stable/common/) for the up-to-date values.
- Updated the image tag to v0.106.3.
### [3.3.1] ### [3.3.1]
#### Changed #### Changed
@ -135,6 +122,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- N/A - N/A
[4.0.0]: #4.0.0
[3.3.1]: #3.3.1 [3.3.1]: #3.3.1
[3.0.0]: #3.0.0 [3.0.0]: #3.0.0

View File

@ -9,6 +9,14 @@ All notable changes to this application Helm chart will be documented in this fi
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### [4.0.0]
#### Changed
- **BREAKING**: Upgraded the common library dependency to version 3.0.1. This introduces several breaking changes (`service`, `ingress` and `persistence` keys have been refactored).
Be sure to check out the [library chart](https://github.com/k8s-at-home/library-charts/blob/common-3.0.0/charts/stable/common/) for the up-to-date values.
- Updated the image tag to v0.106.3.
### [3.3.1] ### [3.3.1]
#### Changed #### Changed
@ -29,6 +37,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- N/A - N/A
[4.0.0]: #4.0.0
[3.3.1]: #3.3.1 [3.3.1]: #3.3.1
[3.0.0]: #3.0.0 [3.0.0]: #3.0.0
{{- end -}} {{- end -}}

View File

@ -1,11 +1,9 @@
persistence: persistence:
config: config:
enabled: true enabled: true
emptyDir: type: emptyDir
enabled: true
mountPath: /opt/adguardhome/conf mountPath: /opt/adguardhome/conf
data: data:
enabled: true enabled: true
emptyDir: type: emptyDir
enabled: true
mountPath: /opt/adguardhome/work mountPath: /opt/adguardhome/work

View File

@ -1,31 +1,17 @@
{{/* Make sure all variables are set properly */}} {{/* Make sure all variables are set properly */}}
{{- include "common.values.setup" . }} {{- include "common.values.setup" . }}
{{/* Append the configMap to the additionalVolumes */}} {{/* Append the configMap volume to the volumes */}}
{{- define "adguard-home.configmap.volume" -}} {{- define "adguard-home.configVolume" -}}
name: adguard-home-config enabled: "true"
mountPath: "/tmp/AdGuardHome.yaml"
subPath: "AdGuardHome.yaml"
type: "custom"
volumeSpec:
configMap: configMap:
name: {{ template "common.names.fullname" . }}-config name: {{ include "common.names.fullname" . }}-config
{{- end -}}
{{- $volume := include "adguard-home.configmap.volume" . | fromYaml -}}
{{- if $volume -}}
{{- $additionalVolumes := append .Values.additionalVolumes $volume }}
{{- $_ := set .Values "additionalVolumes" (deepCopy $additionalVolumes) -}}
{{- end -}}
{{/* Append the configMap volume to the additionalVolumeMounts */}}
{{- define "adguard-home.configmap.volumeMount" -}}
name: adguard-home-config
mountPath: /tmp/AdGuardHome.yaml
subPath: AdGuardHome.yaml
{{- end -}}
{{- $volumeMount := include "adguard-home.configmap.volumeMount" . | fromYaml -}}
{{- if $volumeMount -}}
{{- $additionalVolumeMounts := append .Values.additionalVolumeMounts $volumeMount }}
{{- $_ := set .Values "additionalVolumeMounts" (deepCopy $additionalVolumeMounts) -}}
{{- end -}} {{- end -}}
{{- $_ := set .Values.persistence "adguard-home-config" (include "adguard-home.configVolume" . | fromYaml) -}}
{{/* Render the templates */}} {{/* Render the templates */}}
{{ include "common.all" . }} {{ include "common.all" . }}

View File

@ -5,9 +5,14 @@
# https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml # https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common/values.yaml
# #
# Copy the configmap to the AdGuardHome conf directory controller:
# Do NOT overwrite when the file already exists # -- Number of pods to load balance between
replicas: 1
initContainers: initContainers:
# -- Configures an initContainer that copies the configmap to the AdGuardHome conf directory
# It does NOT overwrite when the file already exists.
# @default -- See values.yaml
- name: copy-configmap - name: copy-configmap
image: busybox image: busybox
command: command:
@ -28,16 +33,20 @@ initContainers:
runAsUser: 0 runAsUser: 0
image: image:
# -- image repository
repository: adguard/adguardhome repository: adguard/adguardhome
tag: v0.105.2 # -- image tag
tag: v0.106.3
# -- image pull policy
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
strategy: # -- environment variables.
type: Recreate # @default -- See below
env:
env: {} # -- Set the container timezone
# TZ: TZ: UTC
# -- arguments passed to the adguard-home command line.
args: args:
- "--config" - "--config"
- "/opt/adguardhome/conf/AdGuardHome.yaml" - "/opt/adguardhome/conf/AdGuardHome.yaml"
@ -45,57 +54,48 @@ args:
- "/opt/adguardhome/work" - "/opt/adguardhome/work"
- "--no-check-update" - "--no-check-update"
# -- (int) Number of pods to load balance between # -- Configures service settings for the chart.
replicas: 1 # @default -- See values.yaml
service: service:
port: main:
primary: true
ports:
http:
port: 3000 port: 3000
# additionalServices: dns-tcp:
# - enabled: true enabled: true
# nameSuffix: dns-tcp type: NodePort
# type: NodePort ports:
# port: dns-tcp:
# port: 53 enabled: true
# name: dns-tcp port: 53
# protocol: TCP protocol: TCP
# targetPort: 53 targetPort: 53
# externalTrafficPolicy: Local externalTrafficPolicy: Local
# - enabled: true dns-udp:
# nameSuffix: dns-udp enabled: true
# type: NodePort type: NodePort
# port: ports:
# port: 53 dns-udp:
# name: dns-udp enabled: true
# protocol: UDP port: 53
# targetPort: 53 protocol: TCP
# externalTrafficPolicy: Local targetPort: 53
externalTrafficPolicy: Local
# -- Configure persistence settings for the chart under this key.
# @default -- See values.yaml
persistence: persistence:
config: config:
enabled: true enabled: true
emptyDir:
enabled: true
mountPath: /opt/adguardhome/conf mountPath: /opt/adguardhome/conf
data: data:
enabled: false enabled: false
emptyDir:
enabled: false
mountPath: /opt/adguardhome/work mountPath: /opt/adguardhome/work
## Persistent Volume Storage Class
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
# storageClass: "-"
# accessMode: ReadWriteOnce
# size: 1Gi
## Do not delete the pvc upon helm uninstall
# skipuninstall: false
# existingClaim: ""
prometheus: prometheus:
# -- Enable and configure a Prometheus serviceMonitor for the chart under this key.
# @default -- See values.yaml
serviceMonitor: serviceMonitor:
enabled: false enabled: false
interval: 30s interval: 30s
@ -105,20 +105,23 @@ prometheus:
# prometheus.io/scrape: "true" # prometheus.io/scrape: "true"
# prometheus.io/port: "api" # prometheus.io/port: "api"
# -- Full list of options https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration # config -- AdGuard Home configuration. For a full list of options see https://github.com/AdguardTeam/AdGuardHome/wiki/Configuration.
# @default -- string # @default -- See values.yaml
config: | config: |
bind_host: 0.0.0.0 bind_host: 0.0.0.0
bind_port: 3000 bind_port: 3000
beta_bind_port: 0 beta_bind_port: 0
users: [] users: []
auth_attempts: 5
block_auth_min: 15
http_proxy: "" http_proxy: ""
language: en language: en
rlimit_nofile: 0 rlimit_nofile: 0
debug_pprof: false debug_pprof: false
web_session_ttl: 720 web_session_ttl: 720
dns: dns:
bind_host: 0.0.0.0 bind_hosts:
- 0.0.0.0
port: 53 port: 53
statistics_interval: 1 statistics_interval: 1
querylog_enabled: true querylog_enabled: true
@ -169,7 +172,9 @@ config: |
cache_time: 30 cache_time: 30
rewrites: [] rewrites: []
blocked_services: [] blocked_services: []
customresolver: null local_domain_name: lan
resolve_clients: true
local_ptr_upstreams: []
tls: tls:
enabled: false enabled: false
server_name: "" server_name: ""
@ -224,4 +229,4 @@ config: |
log_max_age: 3 log_max_age: 3
log_file: "" log_file: ""
verbose: false verbose: false
schema_version: 7 schema_version: 10