This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Resources

cloudflare-operator resources

1 - Account

Learn how to use the Account resource

The API specification can be viewed here.

In order to use cloudflare-operator, you need to create an account resource. This resource contains the credentials for the Cloudflare API.

Learn more about the account resource in the getting started guide.

2 - Zone

Learn how to use the Zone resource

The API specification can be viewed here.

Zone resources represent the zones available in the Cloudflare account. They are used to store the zone id and are fully managed by cloudflare-operator.

Therefore, you should not create or modify zone resources manually.

3 - DNSRecord

Learn how to use the DNSRecord resource

The API specification can be viewed here.

DNSRecord resources represent DNS records in the Cloudflare account.

For each DNS record, you need to create a DNSRecord resource.

cloudflare-operator will create the DNS record in the Cloudflare account and keep it in sync with the DNSRecord resource.

As described in this guide, cloudflare-operator can creaet DNSRecords from Ingress resources.

If you want to create DNSRecords manually, you can use the following example as a starting point:

apiVersion: cloudflare-operator.io/v1
kind: DNSRecord
metadata:
  name: vpn
  namespace: cloudflare-operator
spec:
  name: vpn.example.com
  type: A
  ipRef:
    name: dynamic-external-ipv4-address
  proxied: false
  ttl: 120
  interval: 5m0s

This example creates a DNS record for the domain vpn.example.com with the type A and the IP address from the dynamic-external-ipv4-address IP object.
It also sets the proxied flag to false and the ttl to 120.

Another example is the following:

apiVersion: cloudflare-operator.io/v1
kind: DNSRecord
metadata:
  name: blog
  namespace: cloudflare-operator
spec:
  name: blob.example.com
  content: 69.42.0.69
  type: A
  proxied: true
  ttl: 1
  interval: 5m0s

This example creates a DNS record for the domain blog.example.com with the type A and the content 69.42.0.69.

4 - IP

Learn how to use the IP resource

The API specification can be viewed here.

As described in the core concept, IP objects can be used to follow the “don’t repeat yourself” (DRY) principle.

They also allow you to use the same IP address in multiple DNS records and let you use cloudflare-operator as a dynamic DNS service.

Learn more about the usage of IP objects in the dynamic DNS guide.