cloudflare-ddns
by Aureum Cloud
Helm chart for Cloudflare DDNS
About this chart
Cloudflare DDNS Helm Chart
This Helm chart deploys a Cloudflare Dynamic DNS (DDNS) updater to your Kubernetes cluster. It uses a Docker image to periodically update DNS records in your Cloudflare account based on the external IPs of your Kubernetes nodes.
Prerequisites
- Kubernetes cluster
- Helm 3.x or later
- Cloudflare API token with necessary permissions
Installation
-
Add the Helm repository:
helm repo add cddns https://cloudflare-ddns.aureum.cloud helm repo update -
Install the chart:
helm install my-cloudflare-ddns cddns/cloudflare-ddns \ --values values.yamlReplace
values.yamlwith your custom configuration file.
Configuration
The following table describes the configurable parameters of the chart and their default values:
| Parameter | Description | Default |
|---|---|---|
image.repository | Docker image repository | ghcr.io/aureum-cloud/cloudflare-ddns |
image.tag | Docker image tag | latest |
image.pullPolicy | Image pull policy | IfNotPresent |
externalConfigMap | Name of an external ConfigMap (optional) | "" |
externalSecret | Name of an external Secret (optional) | "" |
config.configJson | Configuration JSON for Cloudflare DDNS | See default in values.yaml |
secrets.cloudflareApiToken | Cloudflare API token | "" |
Example values.yaml
config:
configJson: |
{
"ipv4_enabled": true,
"ipv6_enabled": false,
"ttl": 300,
"zones": [
{
"id": "your_zone_id_here",
"name": "your_root_domain_here",
"update_root_domain": false,
"subdomains": [
"your_subdomain_here"
]
}
]
}
secrets:
cloudflareApiToken: "your_cloudflare_api_token_here"
Using externalConfigMap
An externalConfigMap allows you to provide configuration data from an existing Kubernetes ConfigMap. For example, if you have a config.json file:
-
Create the ConfigMap:
kubectl create configmap cloudflare-ddns-config --from-file=config.json -
Reference the ConfigMap in
values.yaml:externalConfigMap: cloudflare-ddns-configThe
config.jsonfile should follow the expected format, such as:{ "ipv4_enabled": true, "ipv6_enabled": false, "ttl": 300, "zones": [ { "id": "your_zone_id_here", "name": "your_root_domain_here", "update_root_domain": false, "subdomains": [ "your_subdomain_here" ] } ] }
Secrets Management
The externalSecret value is an alternative to authenticate with the Cloudflare API. For security, consider using Kubernetes secrets:
-
Create a Kubernetes Secret:
kubectl create secret generic cloudflare-secrets --from-literal=CLOUDFLARE_API_TOKEN=<your-cloudflare-api-token> -
Reference the Secret in
values.yaml:externalSecret: cloudflare-secrets
Deploy cloudflare-ddns with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cloudflare-ddns on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartcloudflare-ddns is pinned at v1.0.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply