Documentation
¶
Index ¶
- Constants
- Variables
- func BuildK8sUpgradeJobSpec(tcp *talosv1alpha1.TalosControlPlane, image, serviceAccount string) batchv1.JobSpec
- func BuildServiceSpec(name string, i *int32) corev1.ServiceSpec
- func BuildStsSpec(name string, replicas int32, version string, machineType string, ...) appsv1.StatefulSetSpec
- func BuildUserDataEnvVar(configRef *corev1.ConfigMapKeySelector, name string, machineType string) []corev1.EnvVar
- type Cluster
- type Machine
- type TalosClusterAddonReconciler
- type TalosClusterAddonReleaseReconciler
- func (r *TalosClusterAddonReleaseReconciler) GetKubeConfigData(ctx context.Context, tcAddonRelease talosv1alpha1.TalosClusterAddonRelease) (*[]byte, error)
- func (r *TalosClusterAddonReleaseReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *TalosClusterAddonReleaseReconciler) SetupWithManager(mgr ctrl.Manager) error
- type TalosClusterReconciler
- type TalosControlPlaneReconciler
- func (r *TalosControlPlaneReconciler) BootstrapCluster(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) error
- func (r *TalosControlPlaneReconciler) CheckControlPlaneReady(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (bool, error)
- func (r *TalosControlPlaneReconciler) GenerateConfig(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) error
- func (r *TalosControlPlaneReconciler) GetConfigMapData(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (*string, error)
- func (r *TalosControlPlaneReconciler) ImportExistingTalosControlPlane(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (ctrl.Result, error)
- func (r *TalosControlPlaneReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *TalosControlPlaneReconciler) SecretBundle(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (*talos.SecretBundle, error)
- func (r *TalosControlPlaneReconciler) SetConfig(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (*talos.BundleConfig, error)
- func (r *TalosControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *TalosControlPlaneReconciler) WriteControlPlaneConfig(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane, cpConfig *[]byte) error
- func (r *TalosControlPlaneReconciler) WriteKubeconfig(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) error
- func (r *TalosControlPlaneReconciler) WriteTalosConfig(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) error
- type TalosEtcdBackupReconciler
- type TalosEtcdBackupScheduleReconciler
- type TalosMachineReconciler
- func (r *TalosMachineReconciler) CheckMachineBootStatus(ctx context.Context, tm *talosv1alpha1.TalosMachine) (ctrl.Result, error)
- func (r *TalosMachineReconciler) CheckMachineReady(ctx context.Context, tm *talosv1alpha1.TalosMachine) (ctrl.Result, error)
- func (r *TalosMachineReconciler) GetBundleConfig(ctx context.Context, tm *talosv1alpha1.TalosMachine) (*talos.BundleConfig, error)
- func (r *TalosMachineReconciler) GetConfigMapData(ctx context.Context, tm *talosv1alpha1.TalosMachine) (*string, error)
- func (r *TalosMachineReconciler) GetControlPlaneRef(ctx context.Context, tm *talosv1alpha1.TalosMachine) (*talosv1alpha1.TalosControlPlane, error)
- func (r *TalosMachineReconciler) ImportExistingMachine(ctx context.Context, tm *talosv1alpha1.TalosMachine) (ctrl.Result, error)
- func (r *TalosMachineReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *TalosMachineReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *TalosMachineReconciler) UpgradeOrApplyConfig(ctx context.Context, tm *talosv1alpha1.TalosMachine, bc *talos.BundleConfig, ...) error
- type TalosWorkerReconciler
- func (r *TalosWorkerReconciler) CheckWorkerMachinesReady(ctx context.Context, tw *talosv1alpha1.TalosWorker) (bool, error)
- func (r *TalosWorkerReconciler) GenerateConfig(ctx context.Context, tw *talosv1alpha1.TalosWorker) error
- func (r *TalosWorkerReconciler) GetControlPlaneRef(ctx context.Context, tw *talosv1alpha1.TalosWorker) (tcp *talosv1alpha1.TalosControlPlane, err error)
- func (r *TalosWorkerReconciler) ImportExistingTalosWorker(ctx context.Context, tw *talosv1alpha1.TalosWorker) (ctrl.Result, error)
- func (r *TalosWorkerReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *TalosWorkerReconciler) SetConfig(ctx context.Context, tw *talosv1alpha1.TalosWorker) (*talos.BundleConfig, error)
- func (r *TalosWorkerReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *TalosWorkerReconciler) WriteWorkerConfig(ctx context.Context, tw *talosv1alpha1.TalosWorker, wkConfig *[]byte) error
Constants ¶
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" )
const (
TalosImage = "ghcr.io/siderolabs/talos"
)
Variables ¶
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 BuildUserDataEnvVar ¶
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
func (r *TalosClusterAddonReconciler) 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. 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
func (r *TalosClusterAddonReleaseReconciler) 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. 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 (r *TalosControlPlaneReconciler) BootstrapCluster(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) error
func (*TalosControlPlaneReconciler) CheckControlPlaneReady ¶
func (r *TalosControlPlaneReconciler) CheckControlPlaneReady(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (bool, error)
func (*TalosControlPlaneReconciler) GenerateConfig ¶
func (r *TalosControlPlaneReconciler) GenerateConfig(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) error
func (*TalosControlPlaneReconciler) GetConfigMapData ¶ added in v0.2.4
func (r *TalosControlPlaneReconciler) GetConfigMapData(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (*string, error)
func (*TalosControlPlaneReconciler) ImportExistingTalosControlPlane ¶ added in v0.3.3
func (r *TalosControlPlaneReconciler) ImportExistingTalosControlPlane(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (ctrl.Result, error)
func (*TalosControlPlaneReconciler) Reconcile ¶
func (r *TalosControlPlaneReconciler) 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 (*TalosControlPlaneReconciler) SecretBundle ¶
func (r *TalosControlPlaneReconciler) SecretBundle(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (*talos.SecretBundle, error)
func (*TalosControlPlaneReconciler) SetConfig ¶
func (r *TalosControlPlaneReconciler) SetConfig(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) (*talos.BundleConfig, error)
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 (r *TalosControlPlaneReconciler) WriteKubeconfig(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) error
func (*TalosControlPlaneReconciler) WriteTalosConfig ¶
func (r *TalosControlPlaneReconciler) WriteTalosConfig(ctx context.Context, tcp *talosv1alpha1.TalosControlPlane) error
type TalosEtcdBackupReconciler ¶ added in v0.3.0
TalosEtcdBackupReconciler reconciles a TalosEtcdBackup object
func (*TalosEtcdBackupReconciler) Reconcile ¶ added in v0.3.0
func (r *TalosEtcdBackupReconciler) 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. 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
TalosEtcdBackupScheduleReconciler reconciles a TalosEtcdBackupSchedule object
func (*TalosEtcdBackupScheduleReconciler) Reconcile ¶ added in v0.3.1
func (r *TalosEtcdBackupScheduleReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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 (r *TalosMachineReconciler) CheckMachineReady(ctx context.Context, tm *talosv1alpha1.TalosMachine) (ctrl.Result, error)
func (*TalosMachineReconciler) GetBundleConfig ¶
func (r *TalosMachineReconciler) GetBundleConfig(ctx context.Context, tm *talosv1alpha1.TalosMachine) (*talos.BundleConfig, error)
func (*TalosMachineReconciler) GetConfigMapData ¶ added in v0.2.4
func (r *TalosMachineReconciler) GetConfigMapData(ctx context.Context, tm *talosv1alpha1.TalosMachine) (*string, error)
func (*TalosMachineReconciler) GetControlPlaneRef ¶
func (r *TalosMachineReconciler) GetControlPlaneRef(ctx context.Context, tm *talosv1alpha1.TalosMachine) (*talosv1alpha1.TalosControlPlane, error)
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 (r *TalosWorkerReconciler) GenerateConfig(ctx context.Context, tw *talosv1alpha1.TalosWorker) error
func (*TalosWorkerReconciler) GetControlPlaneRef ¶
func (r *TalosWorkerReconciler) GetControlPlaneRef(ctx context.Context, tw *talosv1alpha1.TalosWorker) (tcp *talosv1alpha1.TalosControlPlane, err error)
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 (r *TalosWorkerReconciler) SetConfig(ctx context.Context, tw *talosv1alpha1.TalosWorker) (*talos.BundleConfig, error)
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
Source Files
¶
- cluster_common.go
- constants.go
- container_mode_common.go
- machine_common.go
- predicate.go
- taloscluster_controller.go
- talosclusteraddon_controller.go
- talosclusteraddonrelease_controller.go
- taloscontrolplane_controller.go
- talosetcdbackup_controller.go
- talosetcdbackupschedule_controller.go
- talosmachine_controller.go
- talosworker_controller.go