v1beta1

package
v0.0.0-...-b5ed4c6 Latest Latest
Warning

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

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

Documentation

Overview

Package v1beta1 contains API Schema definitions for the frp v1beta1 API group +kubebuilder:object:generate=true +groupName=frp.gofrp.io

Index

Constants

View Source
const (
	FinalizerName              string = "finalizer.gofrp.io/tracking"
	LabelServiceNameKey        string = "gofrp.io/service-name"
	LabelControllerUidKey      string = "gofrp.io/controller-uid"
	AnnotationFrpServerNameKey string = "service.beta.kubernetes.io/frp-server-name"

	DefaultCaFileName      = "tls.ca"
	DefaultCertFileName    = "tls.crt"
	DefaultKeyFileName     = "tls.key"
	DefaultNatHoleSTUNAddr = "stun.easyvoip.com:3478"
)
View Source
const (
	ReasonInitialized          = "Initialized"
	ReasonInitializeFailed     = "InitializeFailed"
	ReasonGenerateConfigFailed = "GenerateConfigFailed"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "frp.gofrp.io", Version: "v1beta1"}

	// 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 FrpServer

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

	Spec   FrpServerSpec   `json:"spec,omitempty"`
	Status FrpServerStatus `json:"status,omitempty"`
}

FrpServer is the Schema for the frpservers API

func (*FrpServer) DeepCopy

func (in *FrpServer) DeepCopy() *FrpServer

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

func (*FrpServer) DeepCopyInto

func (in *FrpServer) DeepCopyInto(out *FrpServer)

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

func (*FrpServer) DeepCopyObject

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

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

type FrpServerAuth

type FrpServerAuth struct {
	// Method specifies what authentication method to use to
	// authenticate frpc with frps. If "token" is specified - token will be
	// read into login message. If "oidc" is specified - OIDC (Open ID Connect)
	// token will be issued using OIDC settings. By default, this value is "token".
	Method FrpServerAuthMethod `json:"method,omitempty"`
	// AdditionalScopes specify whether to include auth info in additional scope.
	// Current supported scopes are: "HeartBeats", "NewWorkConns".
	// +optional
	AdditionalScopes []FrpServerAuthScope `json:"additionalScopes,omitempty"`
	// Token specifies the authorization token used to create keys to be sent
	// to the server. The server must have a matching token for authorization
	// to succeed.  By default, this value is "".
	Token string `json:"token,omitempty"`
	// +optional
	OIDC *FrpServerAuthOIDC `json:"oidc,omitempty"`
}

func (*FrpServerAuth) DeepCopy

func (in *FrpServerAuth) DeepCopy() *FrpServerAuth

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

func (*FrpServerAuth) DeepCopyInto

func (in *FrpServerAuth) DeepCopyInto(out *FrpServerAuth)

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

type FrpServerAuthMethod

type FrpServerAuthMethod string

FrpServerAuthMethod is the auth method for current FrpServer +enum

const (
	// FrpServerAuthMethodToken means that the FRP server uses the token method to log in
	FrpServerAuthMethodToken FrpServerAuthMethod = "token"
	// FrpServerAuthMethodOIDC means that the FRP server uses the OIDC method to log in
	FrpServerAuthMethodOIDC FrpServerAuthMethod = "oidc"
)

type FrpServerAuthOIDC

type FrpServerAuthOIDC struct {
	// ClientID specifies the client ID to use to get a token in OIDC authentication.
	ClientID string `json:"clientID,omitempty"`
	// ClientSecret specifies the client secret to use to get a token in OIDC
	// authentication.
	ClientSecret string `json:"clientSecret,omitempty"`
	// Audience specifies the audience of the token in OIDC authentication.
	Audience string `json:"audience,omitempty"`
	// Scope specifies the scope of the token in OIDC authentication.
	Scope string `json:"scope,omitempty"`
	// TokenEndpointURL specifies the URL which implements OIDC Token Endpoint.
	// It will be used to get an OIDC token.
	// +optional
	TokenEndpointURL string `json:"tokenEndpointURL,omitempty"`
	// AdditionalEndpointParams specifies additional parameters to be sent
	// this field will be transfer to map[string][]string in OIDC token generator.
	// +optional
	AdditionalEndpointParams map[string]string `json:"additionalEndpointParams,omitempty"`
}

func (*FrpServerAuthOIDC) DeepCopy

func (in *FrpServerAuthOIDC) DeepCopy() *FrpServerAuthOIDC

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

func (*FrpServerAuthOIDC) DeepCopyInto

func (in *FrpServerAuthOIDC) DeepCopyInto(out *FrpServerAuthOIDC)

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

type FrpServerAuthScope

type FrpServerAuthScope string

FrpServerAuthScope is additional scope in auth info +enum

const (
	FrpServerAuthScopeHeartBeats   FrpServerAuthScope = "HeartBeats"
	FrpServerAuthScopeNewWorkConns FrpServerAuthScope = "NewWorkConns"
)

type FrpServerList

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

FrpServerList contains a list of FrpServer

func (*FrpServerList) DeepCopy

func (in *FrpServerList) DeepCopy() *FrpServerList

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

func (*FrpServerList) DeepCopyInto

func (in *FrpServerList) DeepCopyInto(out *FrpServerList)

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

func (*FrpServerList) DeepCopyObject

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

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

type FrpServerPhase

type FrpServerPhase string

FrpServerPhase is the status of a FrpServer at the current time. +enum

const (
	// FrpServerPhasePending means the frp server object has been accepted by the system, but health testing has not started yet
	FrpServerPhasePending FrpServerPhase = "Pending"
	// FrpServerPhaseHealthy means that the health check of the FRP server has passed
	FrpServerPhaseHealthy FrpServerPhase = "Healthy"
	// FrpServerPhaseUnhealthy Means that the health check of the FRP server has not been passed
	FrpServerPhaseUnhealthy FrpServerPhase = "Unhealthy"
	// FrpServerPhaseUnknown means that for some reason the state of the pod could not be obtained, typically due
	// to an error in communicating with the host of the FrpServer.
	FrpServerPhaseUnknown FrpServerPhase = "Unknown"
)

These are the valid statuses of pods.

type FrpServerSpec

type FrpServerSpec struct {
	// the auth config for current FrpServer
	Auth FrpServerAuth `json:"auth,omitempty"`
	// User specifies a prefix for proxy names to distinguish them from other
	// clients. If this value is not "", proxy names will automatically be
	// changed to "{user}.{proxy_name}".
	User string `json:"user,omitempty"`
	// ServerAddr specifies the address of the server to connect to. By
	// default, this value is "0.0.0.0".
	ServerAddr string `json:"serverAddr,omitempty"`
	// ServerPort specifies the port to connect to the server on. By default,
	// this value is 7000.
	ServerPort int `json:"serverPort,omitempty"`
	// ExternalIPs is set for load-balancer ingress points that are DNS/IP based
	ExternalIPs []string `json:"externalIPs,omitempty"`
	// STUN server to help penetrate NAT hole.
	NatHoleSTUNServer string `json:"natHoleStunServer,omitempty"`
	// DNSServer specifies a DNS server address for FRPC to use. If this value
	// is "", the default DNS will be used.
	DNSServer string `json:"dnsServer,omitempty"`
	// LoginFailExit controls whether the client should exit after a
	// failed login attempt. If false, the client will retry until a login
	// attempt succeeds. By default, this value is true.
	LoginFailExit *bool              `json:"loginFailExit,omitempty"`
	Transport     FrpServerTransport `json:"transport,omitempty"`
	// UDPPacketSize specifies the udp packet size
	// By default, this value is 1500
	UDPPacketSize int64 `json:"udpPacketSize,omitempty"`
	// Client metadata info
	Metadatas map[string]string `json:"metadatas,omitempty"`
}

FrpServerSpec defines the desired state of FrpServer

func (*FrpServerSpec) DeepCopy

func (in *FrpServerSpec) DeepCopy() *FrpServerSpec

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

func (*FrpServerSpec) DeepCopyInto

func (in *FrpServerSpec) DeepCopyInto(out *FrpServerSpec)

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

type FrpServerStatus

type FrpServerStatus struct {
	// The phase of a FrpServer is a simple, high-level summary of where the FrpServer is in its lifecycle.
	Phase FrpServerPhase `json:"phase"`
	// Current service state
	// +optional
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`
	// Reason A brief CamelCase message indicating details about why the pod is in this state.
	// +optional
	Reason string `json:"reason,omitempty"`
	// Services is a list of all services
	// +optional
	ServiceReferences []ServiceReference `json:"serviceReferences,omitempty"`
}

FrpServerStatus defines the observed state of FrpServer

func (*FrpServerStatus) DeepCopy

func (in *FrpServerStatus) DeepCopy() *FrpServerStatus

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

func (*FrpServerStatus) DeepCopyInto

func (in *FrpServerStatus) DeepCopyInto(out *FrpServerStatus)

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

type FrpServerTransport

type FrpServerTransport struct {
	// Protocol specifies the protocol to use when interacting with the server.
	// Valid values are "tcp", "kcp", "quic", "websocket" and "wss". By default, this value
	// is "tcp".
	Protocol FrpServerTransportProtocol `json:"protocol,omitempty"`
	// The maximum amount of time a dial to server will wait for a connect to complete.
	DialServerTimeout int64 `json:"dialServerTimeout,omitempty"`
	// DialServerKeepAlive specifies the interval between keep-alive probes for an active network connection between frpc and frps.
	// If negative, keep-alive probes are disabled.
	DialServerKeepAlive int64 `json:"dialServerKeepalive,omitempty"`
	// ConnectServerLocalIP specifies the address of the client bind when it connect to server.
	// Note: This value only use in TCP/Websocket protocol. Not support in KCP protocol.
	ConnectServerLocalIP string `json:"connectServerLocalIP,omitempty"`
	// ProxyURL specifies a proxy address to connect to the server through. If
	// this value is "", the server will be connected directly. By default,
	// this value is read from the "http_proxy" environment variable.
	ProxyURL string `json:"proxyURL,omitempty"`
	// PoolCount specifies the number of connections the client will make to
	// the server in advance.
	PoolCount int `json:"poolCount,omitempty"`
	// TCPMux toggles TCP stream multiplexing. This allows multiple requests
	// from a client to share a single TCP connection. If this value is true,
	// the server must have TCP multiplexing enabled as well. By default, this
	// value is true.
	TCPMux *bool `json:"tcpMux,omitempty"`
	// TCPMuxKeepaliveInterval specifies the keep alive interval for TCP stream multipler.
	// If TCPMux is true, heartbeat of application layer is unnecessary because it can only rely on heartbeat in TCPMux.
	TCPMuxKeepaliveInterval int64 `json:"tcpMuxKeepaliveInterval,omitempty"`
	// QUIC protocol options.
	QUIC *FrpServerTransportQUIC `json:"quic,omitempty"`
	// HeartBeatInterval specifies at what interval heartbeats are sent to the
	// server, in seconds. It is not recommended to change this value. By
	// default, this value is 30. Set negative value to disable it.
	HeartbeatInterval int64 `json:"heartbeatInterval,omitempty"`
	// HeartBeatTimeout specifies the maximum allowed heartbeat response delay
	// before the connection is terminated, in seconds. It is not recommended
	// to change this value. By default, this value is 90. Set negative value to disable it.
	HeartbeatTimeout int64 `json:"heartbeatTimeout,omitempty"`
	// TLS specifies TLS settings for the connection to the server.
	TLS FrpServerTransportTLS `json:"tls,omitempty"`
}

func (*FrpServerTransport) DeepCopy

func (in *FrpServerTransport) DeepCopy() *FrpServerTransport

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

func (*FrpServerTransport) DeepCopyInto

func (in *FrpServerTransport) DeepCopyInto(out *FrpServerTransport)

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

type FrpServerTransportProtocol

type FrpServerTransportProtocol string

FrpServerTransportProtocol specifies the protocol to use when interacting with the server. Valid values are "tcp", "kcp", "quic", "websocket" and "wss". By default, this value is "tcp".

const (
	FrpServerTransportProtocolTCP       FrpServerTransportProtocol = "tcp"
	FrpServerTransportProtocolKCP       FrpServerTransportProtocol = "kcp"
	FrpServerTransportProtocolQUIC      FrpServerTransportProtocol = "quic"
	FrpServerTransportProtocolWebsocket FrpServerTransportProtocol = "websocket"
	FrpServerTransportProtocolWSS       FrpServerTransportProtocol = "wss"
)

type FrpServerTransportQUIC

type FrpServerTransportQUIC struct {
	KeepalivePeriod    int `json:"keepalivePeriod,omitempty"`
	MaxIdleTimeout     int `json:"maxIdleTimeout,omitempty"`
	MaxIncomingStreams int `json:"maxIncomingStreams,omitempty"`
}

FrpServerTransportQUIC the protocol options

func (*FrpServerTransportQUIC) DeepCopy

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

func (*FrpServerTransportQUIC) DeepCopyInto

func (in *FrpServerTransportQUIC) DeepCopyInto(out *FrpServerTransportQUIC)

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

type FrpServerTransportTLS

type FrpServerTransportTLS struct {
	// SecretRef is name of the tls secret for transport. It provided tls key, cert and CA file
	SecretRef *v1.SecretReference `json:"secretRef,omitempty"`
	// ServerName specifies the custom server name of tls certificate. By
	// default, server name if same to ServerAddr.
	ServerName string `json:"serverName,omitempty"`
	// If DisableCustomTLSFirstByte is set to false, frpc will establish a connection with frps using the
	// first custom byte when tls is enabled.
	// Since v0.50.0, the default value has been changed to true, and the first custom byte is disabled by default.
	DisableCustomTLSFirstByte *bool `json:"disableCustomTLSFirstByte,omitempty"`
}

func (*FrpServerTransportTLS) DeepCopy

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

func (*FrpServerTransportTLS) DeepCopyInto

func (in *FrpServerTransportTLS) DeepCopyInto(out *FrpServerTransportTLS)

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

type ServiceReference

type ServiceReference struct {
	// name is unique within a namespace to reference a secret resource.
	// +optional
	Name string `json:"name,omitempty"`
	// namespace defines the space within which the secret name must be unique.
	// +optional
	Namespace string `json:"namespace,omitempty"`
}

ServiceReference represents a Service Reference. It has enough information to retrieve service in any namespace +structType=atomic

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.

Jump to

Keyboard shortcuts

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