v1alpha1

package
v0.0.0-...-c894979 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the networking v1alpha1 API group +kubebuilder:object:generate=true +groupName=networking.cfargotunnel.com

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "networking.cfargotunnel.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

This section is empty.

Types

type CloudflareDetails

type CloudflareDetails struct {
	//+kubebuilder:validation:Required
	// Cloudflare Domain to which this tunnel belongs to
	Domain string `json:"domain,omitempty"`

	//+kubebuilder:validation:Required
	// Secret containing Cloudflare API key/token
	Secret string `json:"secret,omitempty"`

	//+kubebuilder:validation:Optional
	// Account Name in Cloudflare. AccountName and AccountId cannot be both empty. If both are provided, Account ID is used if valid, else falls back to Account Name.
	AccountName string `json:"accountName,omitempty"`

	//+kubebuilder:validation:Optional
	// Account ID in Cloudflare. AccountId and AccountName cannot be both empty. If both are provided, Account ID is used if valid, else falls back to Account Name.
	AccountId string `json:"accountId,omitempty"`

	//+kubebuilder:validation:Optional
	// Email to use along with API Key for Delete operations for new tunnels only, or as an alternate to API Token
	Email string `json:"email,omitempty"`

	//+kubebuilder:validation:Optional
	//+kubebuilder:default:=CLOUDFLARE_API_KEY
	// Key in the secret to use for Cloudflare API Key, defaults to CLOUDFLARE_API_KEY. Needs Email also to be provided.
	// For Delete operations for new tunnels only, or as an alternate to API Token
	CLOUDFLARE_API_KEY string `json:"CLOUDFLARE_API_KEY,omitempty"`

	//+kubebuilder:validation:Optional
	//+kubebuilder:default:=CLOUDFLARE_API_TOKEN
	// Key in the secret to use for Cloudflare API token, defaults to CLOUDFLARE_API_TOKEN
	CLOUDFLARE_API_TOKEN string `json:"CLOUDFLARE_API_TOKEN,omitempty"`

	//+kubebuilder:validation:Optional
	//+kubebuilder:default:=CLOUDFLARE_TUNNEL_CREDENTIAL_FILE
	// Key in the secret to use as credentials.json for an existing tunnel, defaults to CLOUDFLARE_TUNNEL_CREDENTIAL_FILE
	CLOUDFLARE_TUNNEL_CREDENTIAL_FILE string `json:"CLOUDFLARE_TUNNEL_CREDENTIAL_FILE,omitempty"`

	//+kubebuilder:validation:Optional
	//+kubebuilder:default:=CLOUDFLARE_TUNNEL_CREDENTIAL_SECRET
	// Key in the secret to use as tunnel secret for an existing tunnel, defaults to CLOUDFLARE_TUNNEL_CREDENTIAL_SECRET
	CLOUDFLARE_TUNNEL_CREDENTIAL_SECRET string `json:"CLOUDFLARE_TUNNEL_CREDENTIAL_SECRET,omitempty"`
}

CloudflareDetails spec contains all the necessary parameters needed to connect to the Cloudflare API.

func (*CloudflareDetails) DeepCopy

func (in *CloudflareDetails) DeepCopy() *CloudflareDetails

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

func (*CloudflareDetails) DeepCopyInto

func (in *CloudflareDetails) DeepCopyInto(out *CloudflareDetails)

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

type ClusterTunnel

type ClusterTunnel struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   TunnelSpec   `json:"spec,omitempty"`
	Status TunnelStatus `json:"status,omitempty"`
}

ClusterTunnel is the Schema for the clustertunnels API

func (*ClusterTunnel) DeepCopy

func (in *ClusterTunnel) DeepCopy() *ClusterTunnel

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

func (*ClusterTunnel) DeepCopyInto

func (in *ClusterTunnel) DeepCopyInto(out *ClusterTunnel)

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

func (*ClusterTunnel) DeepCopyObject

func (in *ClusterTunnel) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ClusterTunnelList

type ClusterTunnelList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ClusterTunnel `json:"items"`
}

ClusterTunnelList contains a list of ClusterTunnel

func (*ClusterTunnelList) DeepCopy

func (in *ClusterTunnelList) DeepCopy() *ClusterTunnelList

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

func (*ClusterTunnelList) DeepCopyInto

func (in *ClusterTunnelList) DeepCopyInto(out *ClusterTunnelList)

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

func (*ClusterTunnelList) DeepCopyObject

func (in *ClusterTunnelList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ExistingTunnel

type ExistingTunnel struct {
	//+kubebuilder:validation:Optional
	// Existing Tunnel ID to run on. Tunnel ID and Tunnel Name cannot be both empty. If both are provided, ID is used if valid, else falls back to Name.
	Id string `json:"id,omitempty"`

	//+kubebuilder:validation:Optional
	// Existing Tunnel name to run on. Tunnel Name and Tunnel ID cannot be both empty. If both are provided, ID is used if valid, else falls back to Name.
	Name string `json:"name,omitempty"`
}

ExistingTunnel spec needs either a Tunnel Id or a Name to find it on Cloudflare.

func (*ExistingTunnel) DeepCopy

func (in *ExistingTunnel) DeepCopy() *ExistingTunnel

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

func (*ExistingTunnel) DeepCopyInto

func (in *ExistingTunnel) DeepCopyInto(out *ExistingTunnel)

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

type NewTunnel

type NewTunnel struct {
	//+kubebuilder:validation:Required
	// Tunnel name to create on Cloudflare.
	Name string `json:"name,omitempty"`
}

NewTunnel spec needs a name to create a Tunnel on Cloudflare.

func (*NewTunnel) DeepCopy

func (in *NewTunnel) DeepCopy() *NewTunnel

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

func (*NewTunnel) DeepCopyInto

func (in *NewTunnel) DeepCopyInto(out *NewTunnel)

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

type ServiceInfo

type ServiceInfo struct {
	// FQDN of the service
	Hostname string `json:"hostname"`
	// Target for cloudflared
	Target string `json:"target"`
}

ServiceInfo stores the Hostname and Target for each service

func (*ServiceInfo) DeepCopy

func (in *ServiceInfo) DeepCopy() *ServiceInfo

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

func (*ServiceInfo) DeepCopyInto

func (in *ServiceInfo) DeepCopyInto(out *ServiceInfo)

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

type Tunnel

type Tunnel struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   TunnelSpec   `json:"spec,omitempty"`
	Status TunnelStatus `json:"status,omitempty"`
}

Tunnel is the Schema for the tunnels API

func (*Tunnel) DeepCopy

func (in *Tunnel) DeepCopy() *Tunnel

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

func (*Tunnel) DeepCopyInto

func (in *Tunnel) DeepCopyInto(out *Tunnel)

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

func (*Tunnel) DeepCopyObject

func (in *Tunnel) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TunnelBinding

type TunnelBinding struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Subjects  []TunnelBindingSubject `json:"subjects"`
	TunnelRef TunnelRef              `json:"tunnelRef"`
	Status    TunnelBindingStatus    `json:"status,omitempty"`
}

TunnelBinding is the Schema for the tunnelbindings API

func (*TunnelBinding) DeepCopy

func (in *TunnelBinding) DeepCopy() *TunnelBinding

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

func (*TunnelBinding) DeepCopyInto

func (in *TunnelBinding) DeepCopyInto(out *TunnelBinding)

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

func (*TunnelBinding) DeepCopyObject

func (in *TunnelBinding) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TunnelBindingList

type TunnelBindingList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []TunnelBinding `json:"items"`
}

TunnelBindingList contains a list of TunnelBinding

func (*TunnelBindingList) DeepCopy

func (in *TunnelBindingList) DeepCopy() *TunnelBindingList

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

func (*TunnelBindingList) DeepCopyInto

func (in *TunnelBindingList) DeepCopyInto(out *TunnelBindingList)

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

func (*TunnelBindingList) DeepCopyObject

func (in *TunnelBindingList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TunnelBindingStatus

type TunnelBindingStatus struct {
	// To show on the kubectl cli
	Hostnames string        `json:"hostnames"`
	Services  []ServiceInfo `json:"services"`
}

TunnelBindingStatus defines the observed state of TunnelBinding

func (*TunnelBindingStatus) DeepCopy

func (in *TunnelBindingStatus) DeepCopy() *TunnelBindingStatus

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

func (*TunnelBindingStatus) DeepCopyInto

func (in *TunnelBindingStatus) DeepCopyInto(out *TunnelBindingStatus)

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

type TunnelBindingSubject

type TunnelBindingSubject struct {
	// Kind can be Service
	//+kubebuilder:validation:Optional
	//+kubebuilder:default:="Service"
	Kind string `json:"kind"`
	//+kubebuilder:validation:Required
	Name string `json:"name"`
	//+kubebuilder:validation:Optional
	Spec TunnelBindingSubjectSpec `json:"spec"`
}

TunnelBindingSubject defines the subject TunnelBinding connects to the Tunnel

func (*TunnelBindingSubject) DeepCopy

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

func (*TunnelBindingSubject) DeepCopyInto

func (in *TunnelBindingSubject) DeepCopyInto(out *TunnelBindingSubject)

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

type TunnelBindingSubjectSpec

type TunnelBindingSubjectSpec struct {
	// Fqdn specifies the DNS name to access this service from.
	// Defaults to the service.metadata.name + tunnel.spec.domain.
	// If specifying this, make sure to use the same domain that the tunnel belongs to.
	// This is not validated and used as provided
	//+kubebuilder:validation:Optional
	Fqdn string `json:"fqdn,omitempty"`

	// Protocol specifies the protocol for the service. Should be one of http, https, tcp, udp, ssh or rdp.
	// Defaults to http, with the exceptions of https for 443, smb for 139 and 445, rdp for 3389 and ssh for 22 if the service has a TCP port.
	// The only available option for a UDP port is udp, which is default.
	//+kubebuilder:validation:Optional
	Protocol string `json:"protocol,omitempty"`

	// Path specifies a regular expression for to match on the request for http/https services
	// If a rule does not specify a path, all paths will be matched.
	//+kubebuilder:validation:Optional
	Path string `json:"path,omitempty"`

	// Target specified where the tunnel should proxy to.
	// Defaults to the form of <protocol>://<service.metadata.name>.<service.metadata.namespace>.svc:<port>
	//+kubebuilder:validation:Optional
	Target string `json:"target,omitempty"`

	// CaPool trusts the CA certificate referenced by the key in the secret specified in tunnel.spec.originCaPool.
	// tls.crt is trusted globally and does not need to be specified. Only useful if the protocol is HTTPS.
	//+kubebuilder:validation:Optional
	CaPool string `json:"caPool,omitempty"`

	// NoTlsVerify disables TLS verification for this service.
	// Only useful if the protocol is HTTPS.
	//+kubebuilder:validation:Optional
	//+kubebuilder:default:=false
	NoTlsVerify bool `json:"noTlsVerify"`

	// ProxyAddress configures the listen address for that proxy
	//+kubebuilder:validation:Optional
	//+kubebuilder:default:="127.0.0.1"
	//+kubebuilder:validation:Pattern="((^((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))$)|(^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$))"
	ProxyAddress string `json:"proxyAddress,omitempty"`

	// ProxyPort configures the listen port for that proxy
	//+kubebuilder:validation:Optional
	//+kubebuilder:default:=0
	//+kubebuilder:validation:Minimum:=0
	//+kubebuilder:validation:Maximum:=65535
	ProxyPort uint `json:"proxyPort,omitempty"`

	// ProxyType configures the proxy type.
	//+kubebuilder:validation:Optional
	//+kubebuilder:default:=""
	//+kubebuilder:validation:Enum:="";"socks"
	ProxyType string `json:"proxyType,omitempty"`
}

func (*TunnelBindingSubjectSpec) DeepCopy

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

func (*TunnelBindingSubjectSpec) DeepCopyInto

func (in *TunnelBindingSubjectSpec) DeepCopyInto(out *TunnelBindingSubjectSpec)

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

type TunnelList

type TunnelList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Tunnel `json:"items"`
}

TunnelList contains a list of Tunnel

func (*TunnelList) DeepCopy

func (in *TunnelList) DeepCopy() *TunnelList

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

func (*TunnelList) DeepCopyInto

func (in *TunnelList) DeepCopyInto(out *TunnelList)

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

func (*TunnelList) DeepCopyObject

func (in *TunnelList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type TunnelRef

type TunnelRef struct {
	// Kind can be Tunnel or ClusterTunnel
	//+kubebuilder:validation:Required
	Kind string `json:"kind"`
	// Name of the tunnel resource
	//+kubebuilder:validation:Required
	Name string `json:"name"`

	//+kubebuilder:validation:Optional
	// DisableDNSUpdates disables the DNS updates on Cloudflare, just managing the configs. Assumes the DNS entries are manually added.
	DisableDNSUpdates bool `json:"disableDNSUpdates"`
}

TunnelRef defines the Tunnel TunnelBinding connects to

func (*TunnelRef) DeepCopy

func (in *TunnelRef) DeepCopy() *TunnelRef

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

func (*TunnelRef) DeepCopyInto

func (in *TunnelRef) DeepCopyInto(out *TunnelRef)

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

type TunnelSpec

type TunnelSpec struct {
	//+kubebuilder:validation:Minimum=0
	//+kubebuilder:default:=1
	//+kubebuilder:validation:Optional
	// Size defines the number of Daemon pods to run for this tunnel
	Size int32 `json:"size,omitempty"`

	//+kubebuilder:default:="cloudflare/cloudflared:2024.9.1"
	//+kubebuilder:validation:Optional
	// Image sets the Cloudflared Image to use. Defaults to the image set during the release of the operator.
	Image string `json:"image,omitempty"`

	//+kubebuilder:default:=false
	//+kubebuilder:validation:Optional
	// NoTlsVerify disables origin TLS certificate checks when the endpoint is HTTPS.
	NoTlsVerify bool `json:"noTlsVerify,omitempty"`

	//+kubebuilder:validation:Optional
	// OriginCaPool speficies the secret with tls.crt (and other certs as needed to be referred in the service annotation) of the Root CA to be trusted when sending traffic to HTTPS endpoints
	OriginCaPool string `json:"originCaPool,omitempty"`

	//+kubebuilder:validation:Optional
	// NodeSelectors specifies the nodeSelectors to apply to the cloudflared tunnel deployment
	NodeSelectors map[string]string `json:"nodeSelectors,omitempty"`

	//+kubebuilder:validation:Optional
	// Tolerations specifies the tolerations to apply to the cloudflared tunnel deployment
	Tolerations []corev1.Toleration `json:"tolerations,omitempty"`

	//+kubebuilder:validation:Optional
	//+kubebuilder:validation:Enum={"auto","quic","http2"}
	//+kubebuilder:default:="auto"
	// Protocol specifies the protocol to use for the tunnel. Defaults to auto. Options are "auto", "quic" and "http2"
	Protocol string `json:"protocol,omitempty"`

	//+kubebuilder:validation:Optional
	//+kubebuilder:default:="http_status:404"
	// FallbackTarget speficies the target for requests that do not match an ingress. Defaults to http_status:404
	FallbackTarget string `json:"fallbackTarget,omitempty"`

	//+kubebuilder:validation:Required
	// Cloudflare Credentials
	Cloudflare CloudflareDetails `json:"cloudflare,omitempty"`

	//+kubebuilder:validation:Optional
	// Existing tunnel object.
	// ExistingTunnel and NewTunnel cannot be both empty and are mutually exclusive.
	ExistingTunnel ExistingTunnel `json:"existingTunnel,omitempty"`

	//+kubebuilder:validation:Optional
	// New tunnel object.
	// NewTunnel and ExistingTunnel cannot be both empty and are mutually exclusive.
	NewTunnel NewTunnel `json:"newTunnel,omitempty"`
}

TunnelSpec defines the desired state of Tunnel

func (*TunnelSpec) DeepCopy

func (in *TunnelSpec) DeepCopy() *TunnelSpec

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

func (*TunnelSpec) DeepCopyInto

func (in *TunnelSpec) DeepCopyInto(out *TunnelSpec)

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

type TunnelStatus

type TunnelStatus struct {
	TunnelId   string `json:"tunnelId"`
	TunnelName string `json:"tunnelName"`
	AccountId  string `json:"accountId"`
	ZoneId     string `json:"zoneId"`
}

TunnelStatus defines the observed state of Tunnel

func (*TunnelStatus) DeepCopy

func (in *TunnelStatus) DeepCopy() *TunnelStatus

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

func (*TunnelStatus) DeepCopyInto

func (in *TunnelStatus) DeepCopyInto(out *TunnelStatus)

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