#0000 - Refine external-dns setup with error handling and Helm values
Replaced `set -ex` with `set -e` for cleaner error output and added Helm values configuration. Ensured namespace creation doesn't fail if it already exists, and specified a custom values file for better deployment flexibility.
This commit is contained in:
parent
02ad42a186
commit
27f1df27a8
2 changed files with 11 additions and 3 deletions
8
helm-values/external-dns.yaml
Normal file
8
helm-values/external-dns.yaml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
nodeSelector:
|
||||||
|
com.van-hemmen.role: gateway
|
||||||
|
com.van-hemmen.hosting: ovh
|
||||||
|
tolerations:
|
||||||
|
- key: "com.van-hemmen.role"
|
||||||
|
operator: "Equal"
|
||||||
|
value: "gateway"
|
||||||
|
effect: "NoSchedule"
|
6
scripts/04_install_external_dns.sh
Normal file → Executable file
6
scripts/04_install_external_dns.sh
Normal file → Executable file
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -ex
|
set -e
|
||||||
|
|
||||||
# Check if the Cloudflare API token is provided as an argument
|
# Check if the Cloudflare API token is provided as an argument
|
||||||
if [ -z "$1" ]; then
|
if [ -z "$1" ]; then
|
||||||
|
@ -17,10 +17,10 @@ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||||
helm repo update
|
helm repo update
|
||||||
|
|
||||||
# Create the namespace for external DNS
|
# Create the namespace for external DNS
|
||||||
kubectl create namespace external-dns
|
kubectl create namespace external-dns || true
|
||||||
|
|
||||||
# Install the external-dns chart with the provided Cloudflare API token
|
# Install the external-dns chart with the provided Cloudflare API token
|
||||||
helm install external-dns bitnami/external-dns --namespace external-dns \
|
helm install external-dns bitnami/external-dns --namespace external-dns -f helm-values/external-dns.yaml \
|
||||||
--set provider=cloudflare \
|
--set provider=cloudflare \
|
||||||
--set cloudflare.apiToken="$CLOUDFLARE_API_TOKEN" \
|
--set cloudflare.apiToken="$CLOUDFLARE_API_TOKEN" \
|
||||||
--set txtOwnerId=external-dns
|
--set txtOwnerId=external-dns
|
||||||
|
|
Loading…
Reference in a new issue