netbird

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BootstrapSecretType is the type for CAPI bootstrap secrets
	BootstrapSecretType = "cluster.x-k8s.io/secret"

	// PatchedAnnotation marks secrets that have been patched
	PatchedAnnotation = "netbird.exalsius.ai/join-url-patched"

	// PatchedAnnotationValue is the value for the patched annotation
	PatchedAnnotationValue = "true"

	// ClusterNameLabel is the label for cluster name
	ClusterNameLabel = "cluster.x-k8s.io/cluster-name"

	// K0sTokenPath is the path to the k0s token file in cloud-init
	K0sTokenPath = "/etc/k0s.token"
)

Variables

This section is empty.

Functions

func CleanupNetBirdResources

func CleanupNetBirdResources(ctx context.Context, c client.Client, nbClient *netbirdrest.Client, colony *infrav1.Colony) error

CleanupNetBirdResources cleans up NetBird resources when a Colony is deleted.

func GetNetBirdClientFromSecrets

func GetNetBirdClientFromSecrets(ctx context.Context, c client.Client, colony *infrav1.Colony) (*netbirdrest.Client, error)

GetNetBirdClientFromSecrets retrieves the NetBird API key from a Secret and creates a NetBird client.

func GetSetupKeyFromSecret

func GetSetupKeyFromSecret(ctx context.Context, c client.Client, colony *infrav1.Colony) (string, error)

GetSetupKeyFromSecret retrieves the NetBird setup key from a Secret. It uses the auto-generated secret name from status, or constructs the expected name.

func PatchBootstrapSecretsForCluster

func PatchBootstrapSecretsForCluster(
	ctx context.Context,
	c client.Client,
	colony *infrav1.Colony,
	clusterName string,
) error

PatchBootstrapSecretsForCluster patches all bootstrap secrets for a specific cluster to replace URLs with the appropriate endpoint (LoadBalancer external or internal DNS).

func ReconcileNetBird

func ReconcileNetBird(ctx context.Context, c client.Client, colony *infrav1.Colony) error

ReconcileNetBird reconciles NetBird integration for a Colony.

func SecretToColonyMapper

func SecretToColonyMapper(c client.Client) func(context.Context, client.Object) []ctrl.Request

SecretToColonyMapper maps a Secret to Colony reconcile requests This is used in the controller's Watch configuration

func WatchAndPatchBootstrapSecrets

func WatchAndPatchBootstrapSecrets(
	ctx context.Context,
	c client.Client,
	colony *infrav1.Colony,
) error

WatchAndPatchBootstrapSecrets watches for new bootstrap secrets and patches them This can be called from the Colony reconciler after control plane exposure

Types

This section is empty.

Jump to

Keyboard shortcuts

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