cloudflare-ddns

by Aureum Cloud

Helm chartv1.0.3App v1.0.1Verified publisher

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

  1. Add the Helm repository:

    helm repo add cddns https://cloudflare-ddns.aureum.cloud
    helm repo update
    
  2. Install the chart:

    helm install my-cloudflare-ddns cddns/cloudflare-ddns \
      --values values.yaml
    

    Replace values.yaml with your custom configuration file.

Configuration

The following table describes the configurable parameters of the chart and their default values:

ParameterDescriptionDefault
image.repositoryDocker image repositoryghcr.io/aureum-cloud/cloudflare-ddns
image.tagDocker image taglatest
image.pullPolicyImage pull policyIfNotPresent
externalConfigMapName of an external ConfigMap (optional)""
externalSecretName of an external Secret (optional)""
config.configJsonConfiguration JSON for Cloudflare DDNSSee default in values.yaml
secrets.cloudflareApiTokenCloudflare 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:

  1. Create the ConfigMap:

    kubectl create configmap cloudflare-ddns-config --from-file=config.json
    
  2. Reference the ConfigMap in values.yaml:

    externalConfigMap: cloudflare-ddns-config
    

    The config.json file 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:

  1. Create a Kubernetes Secret:

    kubectl create secret generic cloudflare-secrets --from-literal=CLOUDFLARE_API_TOKEN=<your-cloudflare-api-token>
    
  2. 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcloudflare-ddns is pinned at v1.0.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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