Guillaume B.B. Van Hemmen
6be0cdb8c3
Ensure proper file formatting by adding a newline at the end of the script. This adheres to POSIX standards and prevents potential issues with certain tools or environments.
27 lines
810 B
Bash
Executable file
27 lines
810 B
Bash
Executable file
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
# 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
|
|
kubectl create namespace external-dns || true
|
|
|
|
# Install the external-dns chart with the provided Cloudflare API token
|
|
helm install external-dns bitnami/external-dns --namespace external-dns -f helm-values/external-dns.yaml \
|
|
--set provider=cloudflare \
|
|
--set cloudflare.apiToken="$CLOUDFLARE_API_TOKEN" \
|
|
--set txtOwnerId=external-dns
|
|
|