controller

package
v0.0.0-...-74dcd1f Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package controller contains the core reconciliation logic for the UnDyingProxy operator. It manages the lifecycle of UnDyingProxy custom resources, setting up TCP and UDP forwarders, managing associated Kubernetes Services, and handling finalizers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnDyingProxyReconciler

type UnDyingProxyReconciler struct {
	client.Client
	Scheme             *runtime.Scheme
	UDPServiceToManage string
	TCPServiceToManage string
	UDPBufferBytes     int
}

UnDyingProxyReconciler reconciles a UnDyingProxy object. It holds the client for interacting with the Kubernetes API, the scheme for object type mapping, configuration for managed services, and UDP buffer size.

func (*UnDyingProxyReconciler) Reconcile

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

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state defined in the UnDyingProxy custom resource.

It performs the following steps: 1. Fetches the UnDyingProxy instance. 2. Handles deletion logic if the resource is marked for deletion. 3. Ensures the finalizer is present on the resource. 4. Manages TCP forwarding if specified in the spec. 5. Manages UDP forwarding if specified in the spec. 6. Updates the status to Ready.

func (*UnDyingProxyReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager. It configures the controller to watch UnDyingProxy resources and sets the maximum number of concurrent reconciles.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳