#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:
Guillaume "B.B." Van Hemmen 2024-12-27 14:55:28 +01:00
parent 02ad42a186
commit 27f1df27a8
2 changed files with 11 additions and 3 deletions

View 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
View 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