Merge pull request #4583 from tobiabocchi/patch-1

Update cloudflare.md
This commit is contained in:
Kubernetes Prow Robot 2024-07-04 16:06:47 -07:00 committed by GitHub
commit 8d06c84ac4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,7 +57,7 @@ Then apply one of the following manifests file to deploy ExternalDNS.
Create a values.yaml file to configure ExternalDNS to use CloudFlare as the DNS provider. This file should include the necessary environment variables: Create a values.yaml file to configure ExternalDNS to use CloudFlare as the DNS provider. This file should include the necessary environment variables:
```shell ```yaml
provider: provider:
name: cloudflare name: cloudflare
env: env:
@ -75,7 +75,7 @@ env:
Use this in your values.yaml, if you are using API Token: Use this in your values.yaml, if you are using API Token:
```shell ```yaml
provider: provider:
name: cloudflare name: cloudflare
env: env:
@ -120,22 +120,22 @@ spec:
app: external-dns app: external-dns
spec: spec:
containers: containers:
- name: external-dns - name: external-dns
image: registry.k8s.io/external-dns/external-dns:v0.14.2 image: registry.k8s.io/external-dns/external-dns:v0.14.2
args: args:
- --source=service # ingress is also possible - --source=service # ingress is also possible
- --domain-filter=example.com # (optional) limit to only example.com domains; change to match the zone created above. - --domain-filter=example.com # (optional) limit to only example.com domains; change to match the zone created above.
- --zone-id-filter=023e105f4ecef8ad9ca31a8372d0c353 # (optional) limit to a specific zone. - --zone-id-filter=023e105f4ecef8ad9ca31a8372d0c353 # (optional) limit to a specific zone.
- --provider=cloudflare - --provider=cloudflare
- --cloudflare-proxied # (optional) enable the proxy feature of Cloudflare (DDOS protection, CDN...) - --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 - --cloudflare-dns-records-per-page=5000 # (optional) configure how many DNS records to fetch per request
env: env:
- name: CF_API_KEY - name: CF_API_KEY
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: cloudflare-api-key name: cloudflare-api-key
key: apiKey key: apiKey
- name: CF_API_EMAIL - name: CF_API_EMAIL
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: cloudflare-api-key name: cloudflare-api-key
@ -155,15 +155,15 @@ kind: ClusterRole
metadata: metadata:
name: external-dns name: external-dns
rules: rules:
- apiGroups: [""] - apiGroups: [""]
resources: ["services","endpoints","pods"] resources: ["services","endpoints","pods"]
verbs: ["get","watch","list"] verbs: ["get","watch","list"]
- apiGroups: ["extensions","networking.k8s.io"] - apiGroups: ["extensions","networking.k8s.io"]
resources: ["ingresses"] resources: ["ingresses"]
verbs: ["get","watch","list"] verbs: ["get","watch","list"]
- apiGroups: [""] - apiGroups: [""]
resources: ["nodes"] resources: ["nodes"]
verbs: ["list", "watch"] verbs: ["list", "watch"]
--- ---
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
@ -195,26 +195,26 @@ spec:
spec: spec:
serviceAccountName: external-dns serviceAccountName: external-dns
containers: containers:
- name: external-dns - name: external-dns
image: registry.k8s.io/external-dns/external-dns:v0.14.2 image: registry.k8s.io/external-dns/external-dns:v0.14.2
args: args:
- --source=service # ingress is also possible - --source=service # ingress is also possible
- --domain-filter=example.com # (optional) limit to only example.com domains; change to match the zone created above. - --domain-filter=example.com # (optional) limit to only example.com domains; change to match the zone created above.
- --zone-id-filter=023e105f4ecef8ad9ca31a8372d0c353 # (optional) limit to a specific zone. - --zone-id-filter=023e105f4ecef8ad9ca31a8372d0c353 # (optional) limit to a specific zone.
- --provider=cloudflare - --provider=cloudflare
- --cloudflare-proxied # (optional) enable the proxy feature of Cloudflare (DDOS protection, CDN...) - --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 - --cloudflare-dns-records-per-page=5000 # (optional) configure how many DNS records to fetch per request
env: env:
- name: CF_API_KEY - name: CF_API_KEY
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: cloudflare-api-key name: cloudflare-api-key
key: apiKey key: apiKey
- name: CF_API_EMAIL - name: CF_API_EMAIL
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: cloudflare-api-key name: cloudflare-api-key
key: email key: email
``` ```
## Deploying an Nginx Service ## Deploying an Nginx Service
@ -270,7 +270,7 @@ will cause ExternalDNS to remove the corresponding DNS records.
Create the deployment and service: Create the deployment and service:
``` ```shell
$ kubectl create -f nginx.yaml $ kubectl create -f nginx.yaml
``` ```
@ -291,7 +291,7 @@ This should show the external IP address of the service as the A record for your
Now that we have verified that ExternalDNS will automatically manage Cloudflare DNS records, we can delete the tutorial's example: Now that we have verified that ExternalDNS will automatically manage Cloudflare DNS records, we can delete the tutorial's example:
``` ```shell
$ kubectl delete -f nginx.yaml $ kubectl delete -f nginx.yaml
$ kubectl delete -f externaldns.yaml $ kubectl delete -f externaldns.yaml
``` ```