Skip to content

Commit

Permalink
Revert changes to charts/external-dns/README.md and add helm docs for…
Browse files Browse the repository at this point in the history
… docs/tutorials/cloudflare.md
  • Loading branch information
omerap12 committed Apr 24, 2024
1 parent 1b275fc commit a7e487d
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 34 deletions.
29 changes: 0 additions & 29 deletions charts/external-dns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.<name>.<key>` 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: "[email protected]"
```
Replace [email protected] 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 |
Expand Down
44 changes: 39 additions & 5 deletions docs/tutorials/cloudflare.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
```
Expand Down Expand Up @@ -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"
```
Expand Down

0 comments on commit a7e487d

Please sign in to comment.