From 129eea930283d0b2bd28641c6c3ae0cb7630fba1 Mon Sep 17 00:00:00 2001 From: "andrii.k" Date: Wed, 19 Jun 2024 09:17:50 +0300 Subject: [PATCH] add prefetch options to configuration --- stable/node-local-dns/Chart.yaml | 2 +- stable/node-local-dns/README.md | 6 +++++- .../node-local-dns/templates/configmap.yaml | 21 +++++++++++++++++++ stable/node-local-dns/values.yaml | 7 +++++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/stable/node-local-dns/Chart.yaml b/stable/node-local-dns/Chart.yaml index ac655ed9..b0e137d4 100644 --- a/stable/node-local-dns/Chart.yaml +++ b/stable/node-local-dns/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: node-local-dns -version: 2.0.11 +version: 2.0.12 appVersion: 1.23.1 maintainers: - name: gabrieladt diff --git a/stable/node-local-dns/README.md b/stable/node-local-dns/README.md index 219dc882..829791b5 100644 --- a/stable/node-local-dns/README.md +++ b/stable/node-local-dns/README.md @@ -1,6 +1,6 @@ # node-local-dns -![Version: 2.0.11](https://img.shields.io/badge/Version-2.0.11-informational?style=flat-square) ![AppVersion: 1.23.1](https://img.shields.io/badge/AppVersion-1.23.1-informational?style=flat-square) +![Version: 2.0.12](https://img.shields.io/badge/Version-2.0.12-informational?style=flat-square) ![AppVersion: 1.23.1](https://img.shields.io/badge/AppVersion-1.23.1-informational?style=flat-square) A chart to install node-local-dns. @@ -57,6 +57,10 @@ helm install my-release deliveryhero/node-local-dns -f values.yaml | config.dnsServer | string | `"172.20.0.10"` | | | config.healthPort | int | `8080` | | | config.localDns | string | `"169.254.20.25"` | | +| config.prefetch.amount | int | `3` | | +| config.prefetch.duration | string | `"30s"` | | +| config.prefetch.enabled | bool | `false` | | +| config.prefetch.percentage | string | `"20%"` | | | config.setupInterface | bool | `true` | | | config.setupIptables | bool | `true` | | | config.skipTeardown | bool | `false` | | diff --git a/stable/node-local-dns/templates/configmap.yaml b/stable/node-local-dns/templates/configmap.yaml index 970cf381..8db37183 100644 --- a/stable/node-local-dns/templates/configmap.yaml +++ b/stable/node-local-dns/templates/configmap.yaml @@ -16,6 +16,9 @@ data: cache { success 9984 30 denial 9984 5 + {{- if .Values.config.prefetch.enabled}} + prefetch {{ .Values.config.prefetch.amount }} {{ .Values.config.prefetch.duration }} {{ .Values.config.prefetch.percentage }} + {{- end }} } reload loop @@ -32,7 +35,13 @@ data: } in-addr.arpa:53 { errors + {{- if .Values.config.prefetch.enabled}} + cache 30 { + prefetch {{ .Values.config.prefetch.amount }} {{ .Values.config.prefetch.duration }} {{ .Values.config.prefetch.percentage }} + } + {{- else }} cache 30 + {{- end }} reload loop {{- if .Values.config.bindIp }} @@ -47,7 +56,13 @@ data: } ip6.arpa:53 { errors + {{- if .Values.config.prefetch.enabled}} + cache 30 { + prefetch {{ .Values.config.prefetch.amount }} {{ .Values.config.prefetch.duration }} {{ .Values.config.prefetch.percentage }} + } + {{- else }} cache 30 + {{- end }} reload loop {{- if .Values.config.bindIp }} @@ -62,7 +77,13 @@ data: } .:53 { errors + {{- if .Values.config.prefetch.enabled}} + cache 30 { + prefetch {{ .Values.config.prefetch.amount }} {{ .Values.config.prefetch.duration }} {{ .Values.config.prefetch.percentage }} + } + {{- else }} cache 30 + {{- end }} reload loop {{- if .Values.config.bindIp }} diff --git a/stable/node-local-dns/values.yaml b/stable/node-local-dns/values.yaml index 17008181..38ee7b93 100644 --- a/stable/node-local-dns/values.yaml +++ b/stable/node-local-dns/values.yaml @@ -22,6 +22,13 @@ config: # Set communication protocol. Options are `prefer_udp` or `force_tcp` commProtocol: "force_tcp" + # If enabled, coredns will prefetch popular items when they are about to be expunged from the cache. https://coredns.io/plugins/cache/ + prefetch: + enabled: false + amount: 3 + duration: 30s + percentage: 20% + # Port used for the health endpoint healthPort: 8080