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.
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_TOKENSpec
What you set, with the limits the API server enforces.
| Field | Description |
|---|---|
accountIDstringrequired | AccountID is the Cloudflare account ID. |
tokenSecretRefobjectrequired | TokenSecretRef references a Secret containing the CF_API_TOKEN key. |
tokenSecretRef.keystring | Key within the Secret. Defaults to CF_API_TOKEN. Default: |
tokenSecretRef.namestringrequired | Name of the Secret. |
tokenSecretRef.namespacestringrequired | Namespace of the Secret. |
Status
What kflare reports. conditions holds the Ready condition, whose reason says why a resource isn't ready.
| Field | Description |
|---|---|
accountNamestring | 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. |
protectedTokenSecretobject | 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.namestring | name is unique within a namespace to reference a secret resource. |
protectedTokenSecret.namespacestring | namespace defines the space within which the secret name must be unique. |
kubectl get
The columns kubectl get cloudflareaccounts prints.
| Column | Source |
|---|---|
| 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.
# 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