Documentation
¶
Overview ¶
Package gateway implements Kubernetes Gateway API controllers for cloudflared tunnels. This includes controllers for GatewayClass, Gateway, HTTPRoute, TCPRoute, and UDPRoute.
Index ¶
- Constants
- func GetGatewayClass(ctx context.Context, c client.Client, name string) (*gatewayv1.GatewayClass, error)
- func GetGatewayClassForGateway(ctx context.Context, c client.Client, gateway *gatewayv1.Gateway) (*gatewayv1.GatewayClass, error)
- func GetTunnelGatewayClassConfig(ctx context.Context, c client.Client, gatewayClass *gatewayv1.GatewayClass) (*networkingv1alpha2.TunnelGatewayClassConfig, error)
- func IsGatewayManagedByUs(ctx context.Context, c client.Client, gateway *gatewayv1.Gateway) (bool, error)
- func IsOurGatewayClass(gatewayClass *gatewayv1.GatewayClass) bool
- type GatewayClassReconciler
- type GatewayReconciler
Constants ¶
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" )
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 ¶
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.