controller

package
v1.134.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 33 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

Index

Constants

View Source
const (
	// ClientSecretKey is the key in the OAuth2 proxy Secret that holds the OAuth2 client secret
	ClientSecretKey = defaults.OAuthClientSecretKeyName

	// DefaultResyncInterval is how often each RadixApplication is reconciled to correct drift
	DefaultResyncInterval = time.Hour
	// DefaultSecretRotationInterval is how old a client secret can be before it is rotated, when not set
	DefaultSecretRotationInterval = 90 * 24 * time.Hour
	// SyncTimeout is how long the sync of one RadixApplication can take. The sync is not cancelled on shutdown, so the
	// manager's GracefulShutdownTimeout must be longer than this.
	SyncTimeout = 30 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DexClientManager

type DexClientManager interface {
	// EnsureClient creates or updates the client, rotates its secret when it is older than secretRotationInterval,
	// and returns the secret and when it must be rotated
	EnsureClient(ctx context.Context, desired dex.Client, secretRotationInterval time.Duration) (secret string, rotateAt time.Time, err error)
}

DexClientManager ensures that the OAuth2 client of an application exists in Dex

type RadixApplicationReconciler

type RadixApplicationReconciler struct {
	// contains filtered or unexported fields
}

RadixApplicationReconciler reconciles a RadixApplication object

func NewRadixApplicationReconciler

func NewRadixApplicationReconciler(
	c dynclient.Client,
	dexClients DexClientManager,
	oauth2Template *radixv1.OAuth2,
	clusterName, dnsZone, appAliasBaseURL string,
	secretRotationInterval time.Duration,
	maxConcurrentReconciles int,
) *RadixApplicationReconciler

NewRadixApplicationReconciler returns a reconciler that reads and writes Kubernetes objects with c, and manages the OAuth2 clients of applications in Dex with dexClients. secretRotationInterval defaults to DefaultSecretRotationInterval when not set.

func (*RadixApplicationReconciler) Reconcile

Reconcile ensures that RadixApplications with the EasyAuth annotation have the EasyAuth OAuth2 configuration on the public components of all their RadixDeployments, an OAuth2 client in Dex with redirect URIs for all public hosts, and that the client secret from Dex is synced to the OAuth2 proxy of each public component.

The manager cancels ctx on shutdown, so the sync runs on a context that is not cancelled with it, and only bounded by SyncTimeout. A started sync is completed before the manager releases the leader lease, so the Dex client and the client secret in the OAuth2 proxy Secrets are never left half-synced by a shutdown.

func (*RadixApplicationReconciler) SetupWithManager

func (r *RadixApplicationReconciler) 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