Skip to content
Documentation menu

Docs / Reference / Accounts

CloudflareAccount

CloudflareAccount is cluster-scoped and holds credentials for a single Cloudflare account.

API version
kflare.dev/v1alpha1
Scope
Cluster
Short name
cfaccount
Token permission
Account · Account Settings · Read

Example

Every field, with the sample's values. The live lines are the repository's sample, which applies as it is; the commented ones are the other fields, filled from other samples where one sets them. Some exclude each other, so check the rules before you uncomment several.

cloudflareaccount.yaml
apiVersion: kflare.dev/v1alpha1
kind: CloudflareAccount
metadata:
  name: my-account
spec:
  accountID: <your account ID>
  tokenSecretRef:
    name: cloudflare-token
    namespace: kflare-system
    # key: CF_API_TOKEN

Spec

What you set, with the limits the API server enforces.

FieldDescription
accountID
stringrequired

AccountID is the Cloudflare account ID.

tokenSecretRef
objectrequired

TokenSecretRef references a Secret containing the CF_API_TOKEN key.

tokenSecretRef.key
string

Key within the Secret. Defaults to CF_API_TOKEN.

Default: CF_API_TOKEN

tokenSecretRef.name
stringrequired

Name of the Secret.

tokenSecretRef.namespace
stringrequired

Namespace of the Secret.

Status

What kflare reports. conditions holds the Ready condition, whose reason says why a resource isn't ready.

FieldDescription
accountName
string

AccountName is the name of the Cloudflare account as returned by the API.

conditions
[]object

Conditions represent the latest available observations of the account state.

protectedTokenSecret
object

ProtectedTokenSecret is the token Secret kflare holds a finalizer on, so that it cannot be deleted while this account exists. When spec.tokenSecretRef changes, kflare releases this Secret.

protectedTokenSecret.name
string

name is unique within a namespace to reference a secret resource.

protectedTokenSecret.namespace
string

namespace defines the space within which the secret name must be unique.

kubectl get

The columns kubectl get cloudflareaccounts prints.

ColumnSource
ACCOUNT ID.spec.accountID
ACCOUNT NAME.status.accountName
READY.status.conditions[?(@.type=="Ready")].status
AGE.metadata.creationTimestamp

Samples

From the repository's config/samples, comments included.

cloudflare_v1alpha1_cloudflareaccount.yaml
# The credentials the other kinds use, through their accountRef (or their
# zone's). It is cluster-scoped, and its Secret holds an API token with the
# permissions of the kinds you use (docs/deploy.md):
#
#   kubectl -n kflare-system create secret generic cloudflare-token \
#     --from-literal=CF_API_TOKEN=<your API token>
apiVersion: kflare.dev/v1alpha1
kind: CloudflareAccount
metadata:
  name: my-account
spec:
  accountID: <your account ID>
  tokenSecretRef:
    name: cloudflare-token
    namespace: kflare-system

On GitHub