gateway

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: Apache-2.0 Imports: 26 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package gateway implements Kubernetes Gateway API controllers for cloudflared tunnels. This includes controllers for GatewayClass, Gateway, HTTPRoute, TCPRoute, and UDPRoute.

Index

Constants

View Source
const (
	// ControllerName is the name used to identify this controller in GatewayClass
	ControllerName = "cloudflare-operator.io/gateway-controller"

	// FinalizerName is the finalizer used by Gateway API controllers
	FinalizerName = "gateway.cloudflare-operator.io/finalizer"

	// ParametersGroup is the API group for TunnelGatewayClassConfig
	ParametersGroup = "networking.cloudflare-operator.io"

	// ParametersKind is the kind for TunnelGatewayClassConfig
	ParametersKind = "TunnelGatewayClassConfig"

	// KindService is the Kubernetes Service kind
	KindService = "Service"

	// KindGateway is the Gateway API Gateway kind
	KindGateway = "Gateway"

	// Annotations used by Gateway API resources
	AnnotationPrefix = "cloudflare-operator.io/"

	// AnnotationDisableDNS disables DNS management for a specific route
	AnnotationDisableDNS = AnnotationPrefix + "disable-dns"

	// AnnotationDNSProxied overrides the proxied setting for DNS records
	AnnotationDNSProxied = AnnotationPrefix + "dns-proxied"

	// AnnotationProtocol overrides the protocol detection
	AnnotationProtocol = AnnotationPrefix + "protocol"
)
View Source
const (
	ReasonAccepted        = "Accepted"
	ReasonInvalidParams   = "InvalidParameters"
	ReasonParamsNotFound  = "ParametersNotFound"
	ReasonUnsupportedKind = "UnsupportedKind"
)

GatewayClassAccepted condition reasons

Variables

This section is empty.

Functions

func GetGatewayClass

func GetGatewayClass(ctx context.Context, c client.Client, name string) (*gatewayv1.GatewayClass, error)

GetGatewayClass retrieves a GatewayClass by name.

func GetGatewayClassForGateway

func GetGatewayClassForGateway(ctx context.Context, c client.Client, gateway *gatewayv1.Gateway) (*gatewayv1.GatewayClass, error)

GetGatewayClassForGateway retrieves the GatewayClass for a Gateway.

func GetTunnelGatewayClassConfig

func GetTunnelGatewayClassConfig(
	ctx context.Context,
	c client.Client,
	gatewayClass *gatewayv1.GatewayClass,
) (*networkingv1alpha2.TunnelGatewayClassConfig, error)

GetTunnelGatewayClassConfig retrieves the TunnelGatewayClassConfig referenced by a GatewayClass. Returns nil if the GatewayClass doesn't have parametersRef or if it's not a TunnelGatewayClassConfig.

func IsGatewayManagedByUs

func IsGatewayManagedByUs(ctx context.Context, c client.Client, gateway *gatewayv1.Gateway) (bool, error)

IsGatewayManagedByUs returns true if the Gateway's GatewayClass is managed by this controller.

func IsOurGatewayClass

func IsOurGatewayClass(gatewayClass *gatewayv1.GatewayClass) bool

IsOurGatewayClass returns true if the GatewayClass is managed by this controller.

Types

type GatewayClassReconciler

type GatewayClassReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

GatewayClassReconciler reconciles a GatewayClass object

func (*GatewayClassReconciler) Reconcile

func (r *GatewayClassReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile handles GatewayClass reconciliation nolint:revive // Cognitive complexity for GatewayClass validation

func (*GatewayClassReconciler) SetupWithManager

func (r *GatewayClassReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type GatewayReconciler

type GatewayReconciler struct {
	client.Client
	Scheme            *runtime.Scheme
	Recorder          record.EventRecorder
	OperatorNamespace string
}

GatewayReconciler reconciles a Gateway object

func (*GatewayReconciler) Reconcile

func (r *GatewayReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile handles Gateway reconciliation nolint:revive // Cognitive complexity for Gateway reconciliation

func (*GatewayReconciler) SetupWithManager

func (r *GatewayReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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