From d73f54fbd74d9f0c319868cd2c2c12b93e0125b6 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 22 Feb 2022 17:00:49 +0100 Subject: [PATCH] Add probes for LanCache DNS. (#1434) --- charts/incubator/lancache/Chart.yaml | 6 +-- .../incubator/lancache/templates/common.yaml | 39 +++++++++++++++++++ charts/incubator/lancache/values.yaml | 2 +- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/charts/incubator/lancache/Chart.yaml b/charts/incubator/lancache/Chart.yaml index 2f1174e4..8894b236 100644 --- a/charts/incubator/lancache/Chart.yaml +++ b/charts/incubator/lancache/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 1.0.0 description: LanCache Monolithic - a caching proxy server for game download content name: lancache -version: 0.3.0 +version: 0.4.0 kubeVersion: ">=1.16.0-0" keywords: - lancache @@ -21,5 +21,5 @@ dependencies: version: 4.3.0 annotations: artifacthub.io/changes: | - - kind: changed - description: Upgraded `common` chart dependency to version `4.3.0`. + - kind: added + description: Added probes for LanCache DNS container. diff --git a/charts/incubator/lancache/templates/common.yaml b/charts/incubator/lancache/templates/common.yaml index b6d551e9..4497ed12 100644 --- a/charts/incubator/lancache/templates/common.yaml +++ b/charts/incubator/lancache/templates/common.yaml @@ -44,6 +44,45 @@ additionalContainers: - name: dns containerPort: 53 protocol: UDP + livenessProbe: + exec: + command: + - bash + - -c + - | + set -euo pipefail + + # Check if LanCache DNS entries are set up. + dig @127.0.0.1 "${LANCACHE_DNSDOMAIN}" SOA | grep localhost + + # Check if upstream DNS server is reachable. + dig "${LANCACHE_DNSDOMAIN}" SOA + readinessProbe: + exec: + command: + - bash + - -c + - | + set -euo pipefail + + # Check if LanCache DNS entries are set up. + dig @127.0.0.1 "${LANCACHE_DNSDOMAIN}" SOA | grep localhost + + # Check if upstream DNS server is reachable. + dig "${LANCACHE_DNSDOMAIN}" SOA + startupProbe: + exec: + command: + - bash + - -c + - | + set -euo pipefail + + # Check if LanCache DNS entries are set up. + dig @127.0.0.1 "${LANCACHE_DNSDOMAIN}" SOA | grep localhost + + # Check if upstream DNS server is reachable. + dig "${LANCACHE_DNSDOMAIN}" SOA service: dns: diff --git a/charts/incubator/lancache/values.yaml b/charts/incubator/lancache/values.yaml index 41062b9a..968ec106 100644 --- a/charts/incubator/lancache/values.yaml +++ b/charts/incubator/lancache/values.yaml @@ -40,7 +40,7 @@ service: port: 53 # -- LanCache uses custom upstream nameservers, overridable with the `UPSTREAM_DNS` variable. -dnsPolicy: 'None' +dnsPolicy: None dnsConfig: nameservers: - 127.0.0.1