controller

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TalosPlatformKey = "PLATFORM"
	// TalosModeContainer is the mode for Talos running in a container
	TalosModeContainer = "container"
	// TalosModeMetal is the mode for Talos running on bare metal
	TalosModeMetal = "metal"

	// MachineType
	TalosMachineTypeControlPlane = "controlplane"
	TalosMachineTypeWorker       = "worker"

	// ReconcileModeAnnotation is the annotation key for the reconcile mode
	ReconcileModeAnnotation = "talos.alperen.cloud/reconcile-mode"
	// ReconcileMode is the mode of the reconciliation it could be Normal, WatchOnly, EnsureExists, Disable, DryRun (to be implemented)
	ReconcileModeNormal  = "reconcile"
	ReconcileModeDisable = "disable"
	ReconcileModeDryRun  = "dryrun" // TODO: Implement DryRun mode

	// ReconcileModeImport is the mode for importing existing Talos resources
	ReconcileModeImport = "import"

	// For tests
	DefaultNamespace = "default"

	// Deleting is the reason used in conditions when a resource is being deleted
	ConditionReasonDeleting = "Deleting"

	// AppLabelKey is the standard pod label used to select pods backing a Talos
	// control plane StatefulSet/Service.
	AppLabelKey = "app"

	// Field index keys for owner-ref lookups
	IndexControlPlaneRefName = "spec.controlPlaneRef.name"
	IndexWorkerRefName       = "spec.workerRef.name"

	// DeletionPolicyReset is the deletion policy that triggers a Talos reset
	DeletionPolicyReset = "reset"

	// PXE boot stack enabled value
	PxeBootStackEnabled = "true"

	// proc related paths
	ProcPath        = "/proc"
	ProcCmdlineFile = "cmdline"
	DnsmasqCmdline  = "/sbin/tini\u0000--\u0000/usr/bin/dnsmasq.sh\u0000"

	// dnsmasq configuration path
	DnsmasqConfigPath = "/etc/dnsmasq.d/dnsmasq.conf"
	// Default dnsmasq configuration that disables DNS
	DefaultDnsmasqConfig = "port=0"
	// TFTP files
	TftpDir          = "/var/lib/tftp"
	IpxeEfiX8664File = "ipxe-efi-x86_64.efi"
	IpxeEfiArm64File = "ipxe-efi-arm64.efi"
	IpxeEfiX8664Arch = "x86_64-efi"
	IpxeEfiArm64Arch = "arm64-efi"
	IpxeDownloadFile = "ipxe.efi"

	// Matchbox configuration directory mount point in the talos-operator container
	MatchboxConfigPath = "/var/lib/matchbox"
	// Matchbox configuration subdirectories
	MatchboxAssetsDir   = "assets"
	MatchboxGroupsDir   = "groups"
	MatchboxProfilesDir = "profiles"
)
View Source
const (
	TalosImage = "ghcr.io/siderolabs/talos"
)

Variables

View Source
var TalosClusterAddonReleasePredicate = generationChangedPredicate()

Functions

func BuildK8sUpgradeJobSpec added in v0.0.2

func BuildK8sUpgradeJobSpec(tcp *talosv1alpha1.TalosControlPlane, image, serviceAccount string) batchv1.JobSpec

func BuildServiceSpec

func BuildServiceSpec(name string, i *int32) corev1.ServiceSpec

func BuildStsSpec

func BuildStsSpec(name string, replicas int32, version string, machineType string, extraEnvs []corev1.EnvVar, storageClassName *string) appsv1.StatefulSetSpec

func BuildUserDataEnvVar

func BuildUserDataEnvVar(configRef *corev1.ConfigMapKeySelector, name string, machineType string) []corev1.EnvVar

Types

type Cluster added in v0.4.6

type Cluster struct {
	Name         string
	PxeInterface string
	PxeIpAddress string
	MatchboxPort string
	Machines     []Machine
}

Represents a Talos cluster's PXE specifications

type Machine added in v0.4.6

type Machine struct {
	Id                string
	MacAddress        string
	IpAddress         string
	TalosVersion      string
	CpuArchitecture   string
	KernelCmdlineArgs string
}

Represents a Talos machine's PXE specifications

type TalosClusterAddonReconciler added in v0.3.6

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

TalosClusterAddonReconciler reconciles a TalosClusterAddon object

func (*TalosClusterAddonReconciler) Reconcile added in v0.3.6

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the TalosClusterAddon object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.22.1/pkg/reconcile

func (*TalosClusterAddonReconciler) SetupWithManager added in v0.3.6

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

SetupWithManager sets up the controller with the Manager.

type TalosClusterAddonReleaseReconciler added in v0.3.6

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

TalosClusterAddonReleaseReconciler reconciles a TalosClusterAddonRelease object

func (*TalosClusterAddonReleaseReconciler) GetKubeConfigData added in v0.3.6

func (r *TalosClusterAddonReleaseReconciler) GetKubeConfigData(ctx context.Context, tcAddonRelease talosv1alpha1.TalosClusterAddonRelease) (*[]byte, error)

func (*TalosClusterAddonReleaseReconciler) Reconcile added in v0.3.6

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the TalosClusterAddonRelease object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.22.1/pkg/reconcile

func (*TalosClusterAddonReleaseReconciler) SetupWithManager added in v0.3.6

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

SetupWithManager sets up the controller with the Manager.

type TalosClusterReconciler

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

TalosClusterReconciler reconciles a TalosCluster object

func (*TalosClusterReconciler) Reconcile

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

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1/pkg/reconcile

func (*TalosClusterReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type TalosControlPlaneReconciler

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

TalosControlPlaneReconciler reconciles a TalosControlPlane object

func (*TalosControlPlaneReconciler) BootstrapCluster

func (*TalosControlPlaneReconciler) CheckControlPlaneReady

func (r *TalosControlPlaneReconciler) CheckControlPlaneReady(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (bool, error)

func (*TalosControlPlaneReconciler) GenerateConfig

func (*TalosControlPlaneReconciler) GetConfigMapData added in v0.2.4

func (*TalosControlPlaneReconciler) ImportExistingTalosControlPlane added in v0.3.3

func (r *TalosControlPlaneReconciler) ImportExistingTalosControlPlane(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (ctrl.Result, error)

func (*TalosControlPlaneReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1/pkg/reconcile

func (*TalosControlPlaneReconciler) SecretBundle

func (*TalosControlPlaneReconciler) SetConfig

func (*TalosControlPlaneReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*TalosControlPlaneReconciler) WriteControlPlaneConfig

func (r *TalosControlPlaneReconciler) WriteControlPlaneConfig(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane, cpConfig *[]byte) error

func (*TalosControlPlaneReconciler) WriteKubeconfig

func (*TalosControlPlaneReconciler) WriteTalosConfig

type TalosEtcdBackupReconciler added in v0.3.0

type TalosEtcdBackupReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

TalosEtcdBackupReconciler reconciles a TalosEtcdBackup object

func (*TalosEtcdBackupReconciler) Reconcile added in v0.3.0

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. TODO(user): Modify the Reconcile function to compare the state specified by the TalosEtcdBackup object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.22.1/pkg/reconcile

func (*TalosEtcdBackupReconciler) SetupWithManager added in v0.3.0

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

SetupWithManager sets up the controller with the Manager.

type TalosEtcdBackupScheduleReconciler added in v0.3.1

type TalosEtcdBackupScheduleReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

TalosEtcdBackupScheduleReconciler reconciles a TalosEtcdBackupSchedule object

func (*TalosEtcdBackupScheduleReconciler) Reconcile added in v0.3.1

Reconcile is part of the main kubernetes reconciliation loop

func (*TalosEtcdBackupScheduleReconciler) SetupWithManager added in v0.3.1

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

SetupWithManager sets up the controller with the Manager

type TalosMachineReconciler

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

TalosMachineReconciler reconciles a TalosMachine object

func (*TalosMachineReconciler) CheckMachineBootStatus added in v0.4.6

func (r *TalosMachineReconciler) CheckMachineBootStatus(ctx context.Context, tm *talosv1alpha1.TalosMachine) (ctrl.Result, error)

func (*TalosMachineReconciler) CheckMachineReady

func (*TalosMachineReconciler) GetBundleConfig

func (*TalosMachineReconciler) GetConfigMapData added in v0.2.4

func (r *TalosMachineReconciler) GetConfigMapData(ctx context.Context, tm *talosv1alpha1.TalosMachine) (*string, error)

func (*TalosMachineReconciler) GetControlPlaneRef

func (*TalosMachineReconciler) ImportExistingMachine added in v0.3.3

func (r *TalosMachineReconciler) ImportExistingMachine(ctx context.Context, tm *talosv1alpha1.TalosMachine) (ctrl.Result, error)

func (*TalosMachineReconciler) Reconcile

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

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1/pkg/reconcile

func (*TalosMachineReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*TalosMachineReconciler) UpgradeOrApplyConfig

func (r *TalosMachineReconciler) UpgradeOrApplyConfig(ctx context.Context, tm *talosv1alpha1.TalosMachine, bc *talos.BundleConfig, config *[]byte) error

type TalosWorkerReconciler

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

TalosWorkerReconciler reconciles a TalosWorker object

func (*TalosWorkerReconciler) CheckWorkerMachinesReady

func (r *TalosWorkerReconciler) CheckWorkerMachinesReady(ctx context.Context, tw *talosv1alpha1.TalosWorker) (bool, error)

func (*TalosWorkerReconciler) GenerateConfig

func (*TalosWorkerReconciler) GetControlPlaneRef

func (*TalosWorkerReconciler) ImportExistingTalosWorker added in v0.3.3

func (r *TalosWorkerReconciler) ImportExistingTalosWorker(ctx context.Context, tw *talosv1alpha1.TalosWorker) (ctrl.Result, error)

func (*TalosWorkerReconciler) Reconcile

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

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.19.1/pkg/reconcile

func (*TalosWorkerReconciler) SetConfig

func (*TalosWorkerReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

func (*TalosWorkerReconciler) WriteWorkerConfig

func (r *TalosWorkerReconciler) WriteWorkerConfig(ctx context.Context, tw *talosv1alpha1.TalosWorker, wkConfig *[]byte) error

Jump to

Keyboard shortcuts

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