From a7e487d413ec84ba5c70129ff8f91fd84bd2064d Mon Sep 17 00:00:00 2001 From: Omer Date: Wed, 24 Apr 2024 19:52:46 +0300 Subject: [PATCH] Revert changes to charts/external-dns/README.md and add helm docs for docs/tutorials/cloudflare.md --- charts/external-dns/README.md | 29 ----------------------- docs/tutorials/cloudflare.md | 44 +++++++++++++++++++++++++++++++---- 2 files changed, 39 insertions(+), 34 deletions(-) diff --git a/charts/external-dns/README.md b/charts/external-dns/README.md index 451dbc33c7..a94215f64b 100644 --- a/charts/external-dns/README.md +++ b/charts/external-dns/README.md @@ -35,35 +35,6 @@ helm upgrade --install external-dns external-dns/external-dns --version 1.14.4 Configuring the _ExternalDNS_ provider should be done via the `provider.name` value with provider specific configuration being set via the `provider..` values, where supported, and the `extraArgs` value. For legacy support `provider` can be set to the name of the provider with all additional configuration being set via the `extraArgs` value. See [documentation](https://kubernetes-sigs.github.io/external-dns/#new-providers) for more info on available providers and tutorials. -### Provider Example -#### Setting Up ExternalDNS with CloudFlare -To deploy ExternalDNS configured for the CloudFlare DNS provider, begin by creating a Kubernetes secret to securely store your CloudFlare API key. This key will enable ExternalDNS to authenticate with CloudFlare: -```shell -kubectl create secret generic cloudflare-api-key --from-literal=apiKey=YOUR_API_KEY -``` -Ensure to replace YOUR_API_KEY with your actual CloudFlare API key. - -Next, create a values.yaml file to configure ExternalDNS to use CloudFlare as the DNS provider. This file should include the necessary environment variables: -```shell -provider: - name: cloudflare -env: - - name: CF_API_KEY - valueFrom: - secretKeyRef: - name: cloudflare-api-key - key: apiKey - - name: CF_API_EMAIL - value: "example@example.com" -``` -Replace your-email@example.com with the email associated with your CloudFlare account. - -Finally, install the ExternalDNS chart with Helm using the configuration specified in your values.yaml file: -```shell -helm upgrade --install external-dns external-dns/external-dns --version 1.14.4 --values values.yaml -``` -This command will configure ExternalDNS to manage DNS records using CloudFlare, based on resources present in your Kubernetes cluster. - ### Providers with Specific Configuration Support | Provider | Supported | diff --git a/docs/tutorials/cloudflare.md b/docs/tutorials/cloudflare.md index 846ed22722..fd1dd239b5 100644 --- a/docs/tutorials/cloudflare.md +++ b/docs/tutorials/cloudflare.md @@ -34,8 +34,36 @@ Cloudflare API has a [global rate limit of 1,200 requests per five minutes](http ## Deploy ExternalDNS Connect your `kubectl` client to the cluster you want to test ExternalDNS with. + +Begin by creating a Kubernetes secret to securely store your CloudFlare API key. This key will enable ExternalDNS to authenticate with CloudFlare: +```shell +kubectl create secret generic cloudflare-api-key --from-literal=apiKey=YOUR_API_KEY +``` +Ensure to replace YOUR_API_KEY with your actual CloudFlare API key. Then apply one of the following manifests file to deploy ExternalDNS. +### Using Helm + +Create a values.yaml file to configure ExternalDNS to use CloudFlare as the DNS provider. This file should include the necessary environment variables: +```shell +provider: + name: cloudflare +env: + - name: CF_API_KEY + valueFrom: + secretKeyRef: + name: cloudflare-api-key + key: apiKey + - name: CF_API_EMAIL + value: "YOUR_CLOUDFLARE_EMAIL" +``` +Replace YOUR_CLOUDFLARE_EMAIL with the email associated with your CloudFlare account. + +Finally, install the ExternalDNS chart with Helm using the configuration specified in your values.yaml file: +```shell +helm upgrade --install external-dns external-dns/external-dns --version 1.14.4 --values values.yaml +``` + ### Manifest (for clusters without RBAC enabled) ```yaml @@ -64,9 +92,12 @@ spec: - --provider=cloudflare - --cloudflare-proxied # (optional) enable the proxy feature of Cloudflare (DDOS protection, CDN...) - --cloudflare-dns-records-per-page=5000 # (optional) configure how many DNS records to fetch per request - env: - - name: CF_API_KEY - value: "YOUR_CLOUDFLARE_API_KEY" + env: + - name: CF_API_KEY + valueFrom: + secretKeyRef: + name: cloudflare-api-key + key: apiKey - name: CF_API_EMAIL value: "YOUR_CLOUDFLARE_EMAIL" ``` @@ -134,8 +165,11 @@ spec: - --cloudflare-proxied # (optional) enable the proxy feature of Cloudflare (DDOS protection, CDN...) - --cloudflare-dns-records-per-page=5000 # (optional) configure how many DNS records to fetch per request env: - - name: CF_API_KEY - value: "YOUR_CLOUDFLARE_API_KEY" + - name: CF_API_KEY + valueFrom: + secretKeyRef: + name: cloudflare-api-key + key: apiKey - name: CF_API_EMAIL value: "YOUR_CLOUDFLARE_EMAIL" ```