2024-12-19 17:18:36 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2024-12-27 14:55:28 +01:00
|
|
|
set -e
|
2024-12-19 17:18:36 +01:00
|
|
|
|
|
|
|
# Check if the Cloudflare API token is provided as an argument
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Error: Missing Cloudflare API token."
|
|
|
|
echo "Usage: $0 <Cloudflare-API-Token>"
|
|
|
|
echo "You must provide your Cloudflare API token as a parameter to run this script."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
CLOUDFLARE_API_TOKEN=$1
|
|
|
|
|
|
|
|
# Add the Bitnami Helm repository
|
|
|
|
helm repo add bitnami https://charts.bitnami.com/bitnami
|
|
|
|
helm repo update
|
|
|
|
|
|
|
|
# Create the namespace for external DNS
|
2024-12-27 14:55:28 +01:00
|
|
|
kubectl create namespace external-dns || true
|
2024-12-19 17:18:36 +01:00
|
|
|
|
|
|
|
# Install the external-dns chart with the provided Cloudflare API token
|
2024-12-27 14:55:28 +01:00
|
|
|
helm install external-dns bitnami/external-dns --namespace external-dns -f helm-values/external-dns.yaml \
|
2024-12-19 17:18:36 +01:00
|
|
|
--set provider=cloudflare \
|
|
|
|
--set cloudflare.apiToken="$CLOUDFLARE_API_TOKEN" \
|
|
|
|
--set txtOwnerId=external-dns
|