v1alpha1

package
v0.17.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 8, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package v1alpha1 contains shared API types for Cloudflare Zero Trust resources. These types are used across multiple CRDs to provide consistent interfaces for Cloudflare credentials, resource references, and status reporting.

Key types include:

  • CloudflareRef: Unified reference to Cloudflare credentials and account
  • CloudflareCredentials: API authentication configuration
  • CommonStatus: Standard status fields with conditions
  • TunnelReference: Reference to Tunnel/ClusterTunnel resources
  • VirtualNetworkReference: Reference to VirtualNetwork resources

+kubebuilder:object:generate=true +groupName=cloudflare.com

Package v1alpha1 contains API Schema definitions for the cloudflare.com v1alpha1 API group. This package provides shared types for Cloudflare Zero Trust resources. +kubebuilder:object:generate=true +groupName=cloudflare.com

Index

Constants

View Source
const (
	// ConditionTypeReady indicates whether the resource is ready
	ConditionTypeReady = "Ready"

	// ConditionTypeSynced indicates whether the resource is synced with Cloudflare
	ConditionTypeSynced = "Synced"

	// ConditionTypeDegraded indicates whether the resource is in a degraded state
	ConditionTypeDegraded = "Degraded"
)

Condition types for Cloudflare resources

View Source
const (
	// ReasonReconciling indicates the resource is being reconciled
	ReasonReconciling = "Reconciling"

	// ReasonReconciled indicates the resource was successfully reconciled
	ReasonReconciled = "Reconciled"

	// ReasonFailed indicates the reconciliation failed
	ReasonFailed = "Failed"

	// ReasonNotFound indicates a referenced resource was not found
	ReasonNotFound = "NotFound"

	// ReasonInvalidConfig indicates the configuration is invalid
	ReasonInvalidConfig = "InvalidConfig"

	// ReasonAPIError indicates an error from the Cloudflare API
	ReasonAPIError = "APIError"
)

Condition reasons

Variables

View Source
var (
	// GroupVersion is group version used to register these objects.
	GroupVersion = schema.GroupVersion{Group: "cloudflare.com", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func NewCondition

func NewCondition(conditionType string, status metav1.ConditionStatus, reason, message string) metav1.Condition

NewCondition creates a new Condition with the given parameters.

func ReadyCondition

func ReadyCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition

ReadyCondition creates a Ready condition.

func SyncedCondition

func SyncedCondition(status metav1.ConditionStatus, reason, message string) metav1.Condition

SyncedCondition creates a Synced condition.

Types

type CloudflareAccountIdentifier

type CloudflareAccountIdentifier struct {
	// ID is the Cloudflare Account ID.
	// If both ID and Name are provided, ID takes precedence.
	// +kubebuilder:validation:Optional
	ID string `json:"id,omitempty"`

	// Name is the Cloudflare Account Name.
	// Used as a fallback if ID is not provided.
	// +kubebuilder:validation:Optional
	Name string `json:"name,omitempty"`
}

CloudflareAccountIdentifier identifies a Cloudflare account.

func (*CloudflareAccountIdentifier) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudflareAccountIdentifier.

func (*CloudflareAccountIdentifier) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CloudflareAccountRef

type CloudflareAccountRef struct {
	// Credentials for accessing the Cloudflare API.
	// +kubebuilder:validation:Required
	Credentials CloudflareCredentials `json:"credentials"`

	// AccountID is the Cloudflare Account ID.
	// If both AccountID and AccountName are provided, AccountID takes precedence.
	// +kubebuilder:validation:Optional
	AccountID string `json:"accountId,omitempty"`

	// AccountName is the Cloudflare Account Name.
	// Used as a fallback if AccountID is not provided.
	// +kubebuilder:validation:Optional
	AccountName string `json:"accountName,omitempty"`
}

CloudflareAccountRef references a Cloudflare account.

func (*CloudflareAccountRef) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudflareAccountRef.

func (*CloudflareAccountRef) DeepCopyInto

func (in *CloudflareAccountRef) DeepCopyInto(out *CloudflareAccountRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CloudflareCredentials

type CloudflareCredentials struct {
	// SecretRef references a Secret containing API credentials.
	// The Secret should contain either:
	// - CLOUDFLARE_API_TOKEN: An API Token with appropriate permissions
	// - CLOUDFLARE_API_KEY and CLOUDFLARE_API_EMAIL: Global API Key and email
	// +kubebuilder:validation:Required
	SecretRef SecretRef `json:"secretRef"`

	// APITokenKey is the key in the Secret containing the API Token.
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=CLOUDFLARE_API_TOKEN
	APITokenKey string `json:"apiTokenKey,omitempty"`

	// APIKeyKey is the key in the Secret containing the API Key.
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=CLOUDFLARE_API_KEY
	APIKeyKey string `json:"apiKeyKey,omitempty"`

	// APIEmailKey is the key in the Secret containing the account email (for API Key auth).
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=CLOUDFLARE_API_EMAIL
	APIEmailKey string `json:"apiEmailKey,omitempty"`
}

CloudflareCredentials specifies how to authenticate with the Cloudflare API.

func (*CloudflareCredentials) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudflareCredentials.

func (*CloudflareCredentials) DeepCopyInto

func (in *CloudflareCredentials) DeepCopyInto(out *CloudflareCredentials)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CloudflareRef

type CloudflareRef struct {
	// Credentials for accessing the Cloudflare API.
	// +kubebuilder:validation:Required
	Credentials CloudflareCredentials `json:"credentials"`

	// Account references the Cloudflare account.
	// +kubebuilder:validation:Required
	Account CloudflareAccountIdentifier `json:"account"`

	// Zone references the Cloudflare zone (optional, only for zone-scoped resources).
	// +kubebuilder:validation:Optional
	Zone *CloudflareZoneIdentifier `json:"zone,omitempty"`
}

CloudflareRef provides a unified reference to Cloudflare credentials, account, and optionally zone. Use this for resources that need full Cloudflare API access.

func (*CloudflareRef) DeepCopy

func (in *CloudflareRef) DeepCopy() *CloudflareRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudflareRef.

func (*CloudflareRef) DeepCopyInto

func (in *CloudflareRef) DeepCopyInto(out *CloudflareRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CloudflareZoneIdentifier

type CloudflareZoneIdentifier struct {
	// ID is the Cloudflare Zone ID.
	// If both ID and Name are provided, ID takes precedence.
	// +kubebuilder:validation:Optional
	ID string `json:"id,omitempty"`

	// Name is the Cloudflare Zone domain name.
	// Used as a fallback if ID is not provided.
	// +kubebuilder:validation:Optional
	Name string `json:"name,omitempty"`
}

CloudflareZoneIdentifier identifies a Cloudflare zone.

func (*CloudflareZoneIdentifier) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudflareZoneIdentifier.

func (*CloudflareZoneIdentifier) DeepCopyInto

func (in *CloudflareZoneIdentifier) DeepCopyInto(out *CloudflareZoneIdentifier)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CloudflareZoneRef

type CloudflareZoneRef struct {
	// ZoneID is the Cloudflare Zone ID.
	// If both ZoneID and Domain are provided, ZoneID takes precedence.
	// +kubebuilder:validation:Optional
	ZoneID string `json:"zoneId,omitempty"`

	// Domain is the Cloudflare Zone domain name.
	// Used as a fallback if ZoneID is not provided.
	// +kubebuilder:validation:Optional
	Domain string `json:"domain,omitempty"`
}

CloudflareZoneRef references a Cloudflare zone (domain).

func (*CloudflareZoneRef) DeepCopy

func (in *CloudflareZoneRef) DeepCopy() *CloudflareZoneRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudflareZoneRef.

func (*CloudflareZoneRef) DeepCopyInto

func (in *CloudflareZoneRef) DeepCopyInto(out *CloudflareZoneRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type CommonStatus

type CommonStatus struct {
	// ObservedGeneration is the most recent generation observed by the controller.
	// +kubebuilder:validation:Optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

	// Conditions represent the latest available observations of the resource's state.
	// +kubebuilder:validation:Optional
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// LastReconcileTime is the last time the resource was reconciled.
	// +kubebuilder:validation:Optional
	LastReconcileTime *metav1.Time `json:"lastReconcileTime,omitempty"`
}

CommonStatus contains common status fields for all Cloudflare resources.

func (*CommonStatus) DeepCopy

func (in *CommonStatus) DeepCopy() *CommonStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CommonStatus.

func (*CommonStatus) DeepCopyInto

func (in *CommonStatus) DeepCopyInto(out *CommonStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CommonStatus) GetCondition

func (s *CommonStatus) GetCondition(conditionType string) *metav1.Condition

GetCondition returns the condition with the given type, or nil if not found.

func (*CommonStatus) IsReady

func (s *CommonStatus) IsReady() bool

IsReady returns true if the Ready condition is True.

func (*CommonStatus) SetCondition

func (s *CommonStatus) SetCondition(condition metav1.Condition)

SetCondition sets or updates a condition on the CommonStatus.

type ExistingTunnelRef

type ExistingTunnelRef struct {
	// ID is the Cloudflare Tunnel ID.
	// If both ID and Name are provided, ID takes precedence.
	// +kubebuilder:validation:Optional
	ID string `json:"id,omitempty"`

	// Name is the Cloudflare Tunnel name.
	// Used as a fallback if ID is not provided.
	// +kubebuilder:validation:Optional
	Name string `json:"name,omitempty"`
}

ExistingTunnelRef references an existing Cloudflare tunnel.

func (*ExistingTunnelRef) DeepCopy

func (in *ExistingTunnelRef) DeepCopy() *ExistingTunnelRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExistingTunnelRef.

func (*ExistingTunnelRef) DeepCopyInto

func (in *ExistingTunnelRef) DeepCopyInto(out *ExistingTunnelRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type FallbackDomainEntry

type FallbackDomainEntry struct {
	// Suffix is the domain suffix (e.g., "internal.company.com").
	// +kubebuilder:validation:Required
	Suffix string `json:"suffix"`

	// DNSServer is the DNS server to use for this domain.
	// +kubebuilder:validation:Optional
	DNSServer []string `json:"dnsServer,omitempty"`

	// Description for the entry.
	// +kubebuilder:validation:Optional
	Description string `json:"description,omitempty"`
}

FallbackDomainEntry represents an entry in the local domain fallback configuration.

func (*FallbackDomainEntry) DeepCopy

func (in *FallbackDomainEntry) DeepCopy() *FallbackDomainEntry

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FallbackDomainEntry.

func (*FallbackDomainEntry) DeepCopyInto

func (in *FallbackDomainEntry) DeepCopyInto(out *FallbackDomainEntry)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NewTunnelSpec

type NewTunnelSpec struct {
	// Name for the new tunnel.
	// +kubebuilder:validation:Required
	Name string `json:"name"`
}

NewTunnelSpec specifies parameters for creating a new tunnel.

func (*NewTunnelSpec) DeepCopy

func (in *NewTunnelSpec) DeepCopy() *NewTunnelSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NewTunnelSpec.

func (*NewTunnelSpec) DeepCopyInto

func (in *NewTunnelSpec) DeepCopyInto(out *NewTunnelSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretKeyRef

type SecretKeyRef struct {
	// Name of the Secret.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// Key within the Secret.
	// +kubebuilder:validation:Required
	Key string `json:"key"`

	// Namespace of the Secret. If empty, defaults to the namespace of the resource.
	// +kubebuilder:validation:Optional
	Namespace string `json:"namespace,omitempty"`
}

SecretKeyRef references a key within a Secret.

func (*SecretKeyRef) DeepCopy

func (in *SecretKeyRef) DeepCopy() *SecretKeyRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretKeyRef.

func (*SecretKeyRef) DeepCopyInto

func (in *SecretKeyRef) DeepCopyInto(out *SecretKeyRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretRef

type SecretRef struct {
	// Name of the Secret.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// Namespace of the Secret. If empty, defaults to the namespace of the resource.
	// +kubebuilder:validation:Optional
	Namespace string `json:"namespace,omitempty"`
}

SecretRef references a Secret in a specific namespace.

func (*SecretRef) DeepCopy

func (in *SecretRef) DeepCopy() *SecretRef

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretRef.

func (*SecretRef) DeepCopyInto

func (in *SecretRef) DeepCopyInto(out *SecretRef)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ServiceReference

type ServiceReference struct {
	// Name of the Service.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// Namespace of the Service. If empty, defaults to the namespace of the referencing resource.
	// +kubebuilder:validation:Optional
	Namespace string `json:"namespace,omitempty"`

	// Port of the Service to use.
	// +kubebuilder:validation:Optional
	Port *int32 `json:"port,omitempty"`
}

ServiceReference references a Kubernetes Service.

func (*ServiceReference) DeepCopy

func (in *ServiceReference) DeepCopy() *ServiceReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceReference.

func (*ServiceReference) DeepCopyInto

func (in *ServiceReference) DeepCopyInto(out *ServiceReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SplitTunnelEntry

type SplitTunnelEntry struct {
	// Address is the IP address or CIDR range.
	// +kubebuilder:validation:Optional
	Address string `json:"address,omitempty"`

	// Host is the hostname or domain.
	// +kubebuilder:validation:Optional
	Host string `json:"host,omitempty"`

	// Description for the entry.
	// +kubebuilder:validation:Optional
	Description string `json:"description,omitempty"`
}

SplitTunnelEntry represents an entry in the split tunnel configuration.

func (*SplitTunnelEntry) DeepCopy

func (in *SplitTunnelEntry) DeepCopy() *SplitTunnelEntry

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SplitTunnelEntry.

func (*SplitTunnelEntry) DeepCopyInto

func (in *SplitTunnelEntry) DeepCopyInto(out *SplitTunnelEntry)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TunnelReference

type TunnelReference struct {
	// Kind of the tunnel resource (Tunnel or ClusterTunnel).
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=Tunnel;ClusterTunnel
	// +kubebuilder:default=ClusterTunnel
	Kind string `json:"kind"`

	// Name of the Tunnel or ClusterTunnel resource.
	// +kubebuilder:validation:Required
	Name string `json:"name"`

	// Namespace of the Tunnel resource. Only applicable when Kind is Tunnel.
	// If empty, defaults to the namespace of the referencing resource.
	// +kubebuilder:validation:Optional
	Namespace string `json:"namespace,omitempty"`
}

TunnelReference references a Tunnel or ClusterTunnel resource.

func (*TunnelReference) DeepCopy

func (in *TunnelReference) DeepCopy() *TunnelReference

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TunnelReference.

func (*TunnelReference) DeepCopyInto

func (in *TunnelReference) DeepCopyInto(out *TunnelReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TunnelSource

type TunnelSource struct {
	// ExistingTunnel references an existing tunnel by ID or name.
	// Mutually exclusive with NewTunnel.
	// +kubebuilder:validation:Optional
	ExistingTunnel *ExistingTunnelRef `json:"existingTunnel,omitempty"`

	// NewTunnel creates a new tunnel with the given name.
	// Mutually exclusive with ExistingTunnel.
	// +kubebuilder:validation:Optional
	NewTunnel *NewTunnelSpec `json:"newTunnel,omitempty"`

	// CredentialSecretRef references a Secret containing tunnel credentials.
	// Required for ExistingTunnel, optional for NewTunnel (will be created).
	// +kubebuilder:validation:Optional
	CredentialSecretRef *SecretKeyRef `json:"credentialSecretRef,omitempty"`
}

TunnelSource specifies where to get or create a tunnel.

func (*TunnelSource) DeepCopy

func (in *TunnelSource) DeepCopy() *TunnelSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TunnelSource.

func (*TunnelSource) DeepCopyInto

func (in *TunnelSource) DeepCopyInto(out *TunnelSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type VirtualNetworkReference

type VirtualNetworkReference struct {
	// Name of the VirtualNetwork resource.
	// +kubebuilder:validation:Required
	Name string `json:"name"`
}

VirtualNetworkReference references a VirtualNetwork resource.

func (*VirtualNetworkReference) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VirtualNetworkReference.

func (*VirtualNetworkReference) DeepCopyInto

func (in *VirtualNetworkReference) DeepCopyInto(out *VirtualNetworkReference)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WARPRoutingConfig

type WARPRoutingConfig struct {
	// Enabled enables or disables WARP routing for the tunnel.
	// +kubebuilder:validation:Optional
	// +kubebuilder:default=false
	Enabled bool `json:"enabled,omitempty"`
}

WARPRoutingConfig specifies WARP routing configuration for a tunnel.

func (*WARPRoutingConfig) DeepCopy

func (in *WARPRoutingConfig) DeepCopy() *WARPRoutingConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WARPRoutingConfig.

func (*WARPRoutingConfig) DeepCopyInto

func (in *WARPRoutingConfig) DeepCopyInto(out *WARPRoutingConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL