This tutorial shows you how to get started with using cloudflare-operator and create a sample DNS record.
Before you begin
The following prerequisites are required to complete this tutorial:
- A Kubernetes cluster with cloudflare-operator installed (follow the installation guide)
- A Cloudflare account
Note that after a successful installation and configuration, cloudflare-operator will delete ALL DNS records in EVERY ZONE to which the API token has access!
It is therefore highly recommended to export your existing DNS records first!
Create Cloudflare API token
The token can be created by following this guide.
The following permissions are required:
Configure the following
or, if you want to limit the zones to which the token has access:
The summary should look similar to this:
All zones - Zone:Read, DNS:Edit
Configure Cloudflare account
Create a secret with the previously created Cloudflare API token.
The key in the secret must be named
Next, create an account object:
Did you export your existing DNS records?
After creating the account, cloudflare-operator will delete ALL DNS records in EVERY ZONE to which the API token has access!
This is your last chance to export your existing DNS records!
Check if the account is ready:
kubectl get accounts.cloudflare-operator.io
This should output the following:
kubectl get zones.cloudflare-operator.io
NAME ZONE NAME ID READY
example-com example.com 12345678901234567890123456789012 True
Create a DNS record
Now, we can create our first DNS record:
Check the status of the DNS record:
kubectl get dnsrecords.cloudflare-operator.io --namespace cloudflare-operator
NAME RECORD NAME TYPE READY
example-com example.com A True