Documentation
¶
Index ¶
- Variables
- func APIServerNeedsProxy(apiServerURL string) bool
- func AnnotateOperatorCRDsKeep(ctx context.Context, kubeconfig string, logger Logger) error
- func ApplyPlatformPinsToConfig(cfg *config.Config, pins *api.PlatformPins, log Logger)
- func ApplyToolPins(v *Validator, pins *api.PlatformPins)
- func CompareSemverLoose(current, required string) (int, error)
- func CredentialsSecretName(helmRelease, instanceID string) string
- func DeriveToolDownloadURL(name, version, goos, goarch, override string) (string, error)
- func DetectInstalledComponents(ctx context.Context) (k3s, calico, liqo, apiReachable bool)
- func EnsureCLIBinDir() (string, error)
- func EnsureHypervisorCRDs(ctx context.Context, kubeconfig string, logger Logger) error
- func EnsurePterodactylLiqoRBAC(ctx context.Context, kubeconfig string) error
- func EnsureRFBVNCGatewayImage(ctx context.Context, repository, tag string, logger Logger) error
- func EnsureReadableKubeconfig(ctx context.Context, preferred string, logger Logger) string
- func InPlaceUpgradeArgs(u OperatorUpgrade) []string
- func NormalizeHypervisorAPIURL(raw string) string
- func ParseHelmInstanceSecrets(valuesYAML []byte, driver string) ([]string, error)
- func PrependPath(dir string)
- func ResolveDefaultKubeconfig() string
- func ResolveOperatorChart(explicit string) (chart string, version string)
- func ResolveSolusVMOperatorChart(explicit string) (chart string, version string)
- func ResolveVirtFusionOperatorChart(explicit string) (chart string, version string)
- func SolusVMCredentialsSecretName(helmRelease, instanceID string) string
- func UpgradeOperatorRelease(ctx context.Context, u OperatorUpgrade, logger Logger) error
- func VerifySHA256File(path, expectedHex string) error
- func VersionSatisfies(current, required, minVersion string) bool
- func VersionsMap(pins *api.PlatformPins) map[string]string
- func VirtFusionCredentialsSecretName(helmRelease, instanceID string) string
- type CalicoConfig
- type CalicoInstaller
- type ClusterCleaner
- func (c *ClusterCleaner) CleanupHostLeftovers(ctx context.Context) error
- func (c *ClusterCleaner) CleanupLiqoTenantLeftovers(ctx context.Context) error
- func (c *ClusterCleaner) CleanupRemotePeeringLeftovers(ctx context.Context, remoteKubeconfig, agentID string) error
- func (c *ClusterCleaner) ForceCleanupAll(ctx context.Context, peeringKubeconfig string) []error
- func (c *ClusterCleaner) UninstallCalico(ctx context.Context) error
- func (c *ClusterCleaner) UninstallK3s(ctx context.Context) error
- func (c *ClusterCleaner) UninstallLiqo(ctx context.Context, kubeconfigPath string) error
- func (c *ClusterCleaner) UnoffloadNamespaces(ctx context.Context) error
- func (c *ClusterCleaner) UnpeerLiqo(ctx context.Context, remoteKubeconfig string) error
- func (c *ClusterCleaner) WaitForPlatformUnpeer(ctx context.Context) error
- type K3sConfig
- type K3sInstaller
- type LiqoConfig
- type LiqoManager
- func (l *LiqoManager) GeneratePeeringUser(ctx context.Context, consumerClusterID, outPath string) error
- func (l *LiqoManager) GetAPIServerProxyIP(ctx context.Context) (string, error)
- func (l *LiqoManager) GetPeeredClusterID(ctx context.Context) (string, error)
- func (l *LiqoManager) Install(ctx context.Context) error
- func (l *LiqoManager) IsInstalled(ctx context.Context) bool
- func (l *LiqoManager) IsPeeringComplete(ctx context.Context) (bool, error)
- func (l *LiqoManager) NeedsPeeringReset(ctx context.Context) (bool, error)
- func (l *LiqoManager) OffloadNamespace(ctx context.Context, ...) error
- func (l *LiqoManager) Peer(ctx context.Context, kubeconfigPath string, gwServerServicePort string) error
- func (l *LiqoManager) PeerAfterReset(ctx context.Context, kubeconfigPath string, gwServerServicePort string) error
- func (l *LiqoManager) PrepareGameCatalogReflection(ctx context.Context) error
- func (l *LiqoManager) ResetPartialPeering(ctx context.Context, remoteKubeconfigPath string)
- func (l *LiqoManager) ResolveInboundAPIServerProxyURL(ctx context.Context, remoteKubeconfigPath, localClusterID string) (string, error)
- type Logger
- type OperatorUpgrade
- type ProxmoxInstance
- type ProxmoxOperatorConfig
- type ProxmoxOperatorInstaller
- type ReusableOperator
- type SolusVMInstance
- type SolusVMOperatorConfig
- type SolusVMOperatorInstaller
- type SudoManager
- type SystemCheckResult
- type SystemValidator
- type ToolBootstrapper
- type ToolRequirement
- type ValidationResult
- type Validator
- type VersionChecker
- type VirtFusionInstance
- type VirtFusionOperatorConfig
- type VirtFusionOperatorInstaller
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoReusableOperator means no Helm release with existing instance Secrets was found. ErrNoReusableOperator = errors.New("no reusable operator helm release") // ErrAmbiguousOperatorRelease means more than one hypervisor operator release is installed. ErrAmbiguousOperatorRelease = errors.New("multiple operator helm releases found") )
Functions ¶
func APIServerNeedsProxy ¶ added in v1.0.12
APIServerNeedsProxy reports whether a Kubernetes API server URL is unreachable from outside the cluster's own network, and so has to be proxied through the Liqo tunnel. DNS names are assumed routable: only literal non-public addresses are proxied.
func AnnotateOperatorCRDsKeep ¶ added in v1.0.16
AnnotateOperatorCRDsKeep marks operator CRDs so a later chart upgrade with crds.enabled=false does not delete them.
func ApplyPlatformPinsToConfig ¶
func ApplyPlatformPinsToConfig(cfg *config.Config, pins *api.PlatformPins, log Logger)
ApplyPlatformPinsToConfig overlays server pins onto local config (server wins).
func ApplyToolPins ¶
func ApplyToolPins(v *Validator, pins *api.PlatformPins)
ApplyToolPins sets tool minimums from GetPlatformVersions pins. MinVersion is preferred; Version is used when MinVersion is empty (exact pin as floor).
func CompareSemverLoose ¶
CompareSemverLoose compares versions after normalizing common prefixes/suffixes. Returns -1, 0, 1 like semver Compare, or error if unparsable.
func CredentialsSecretName ¶
CredentialsSecretName matches the chart fullname: {release}-proxmox-operator-proxmox-credentials-{id}.
func DeriveToolDownloadURL ¶
DeriveToolDownloadURL builds a download URL for a tool, or uses override when set.
func DetectInstalledComponents ¶
DetectInstalledComponents probes the host/cluster for installed pieces.
func EnsureCLIBinDir ¶
EnsureCLIBinDir creates ~/.nr/bin and prepends it to PATH for this process.
func EnsureHypervisorCRDs ¶
EnsureHypervisorCRDs installs the Proxmox, VirtFusion, SolusVM, and Pterodactyl CRD charts. Mothership Liqo AllowList always includes those API groups; missing CRDs on a provider stall custom-resource informers with "the server could not find the requested resource".
Agents that installed CRDs as the operator chart subchart already own those objects. Helm 3.16 cannot --take-ownership, so we apply the CRD chart in place instead of failing the upgrade.
func EnsurePterodactylLiqoRBAC ¶ added in v1.0.17
EnsurePterodactylLiqoRBAC merges the Pterodactyl reflection rules into the Liqo virtual-kubelet roles. A Proxmox agent that later runs install-pterodactyl already has Liqo, and that command does not re-run liqoctl, so this is what updates the roles. When Liqo is not installed yet the roles are absent and the later register path adds them.
func EnsureRFBVNCGatewayImage ¶
EnsureRFBVNCGatewayImage builds vnc-gateway:local-rfb from the sibling checkout (if needed) and imports it into k3s as repository:tag. Proxmox agents must not call this — they pull Harbor :main. No-ops when SKIP_VNC_GATEWAY_IMAGE_LOAD=1 or when the tag is Harbor stock main.
func EnsureReadableKubeconfig ¶
EnsureReadableKubeconfig returns a kubeconfig path the current user can read. If preferred (or a discovered path) exists but is not readable (typical for root-owned /etc/rancher/k3s/k3s.yaml with mode 600), it copies the file via sudo into ~/.nr/k3s.kubeconfig (mode 0600) and returns that path.
When /etc/rancher/k3s/k3s.yaml exists and is newer than the cached copy (e.g. after k3s reinstall), the cache is refreshed so TLS clients do not keep using a stale CA from a previous cluster.
func InPlaceUpgradeArgs ¶ added in v1.0.14
func InPlaceUpgradeArgs(u OperatorUpgrade) []string
InPlaceUpgradeArgs is the helm argv for a credential-preserving chart/image bump. --reset-then-reuse-values keeps existingSecret / instances while picking up new chart keys (hooks, exporter image). --reuse-values alone drops those defaults and 0.1.2→0.1.3 fails on .Values.hooks.enabled. image.tag is always set so an old reused tag cannot stick (never the bare chart version).
This is `helm upgrade` without `--install`: a missing release must fail closed rather than deploying an operator with empty instance Secrets.
func NormalizeHypervisorAPIURL ¶ added in v1.0.2
NormalizeHypervisorAPIURL trims whitespace and trailing slashes so https://192.168.1.103/ and https://192.168.1.103 store as the same origin. Operators append their API path (VirtFusion/SolusVM /api/v1, Proxmox /api2/json).
func ParseHelmInstanceSecrets ¶ added in v1.0.14
ParseHelmInstanceSecrets returns existingSecret names from user-supplied Helm values.
func PrependPath ¶
func PrependPath(dir string)
PrependPath puts dir at the front of PATH if not already present.
func ResolveDefaultKubeconfig ¶
func ResolveDefaultKubeconfig() string
ResolveDefaultKubeconfig returns a best-effort kubeconfig path that is readable by the current user when possible.
func ResolveOperatorChart ¶
ResolveOperatorChart returns local path, OCI ref, or empty. Precedence: explicit path/OCI → sibling checkout → Harbor OCI default.
func ResolveSolusVMOperatorChart ¶
ResolveSolusVMOperatorChart returns local path, OCI ref, or empty. Precedence: explicit path/OCI → SOLUSVM_OPERATOR_CHART → sibling checkout → Harbor OCI default.
func ResolveVirtFusionOperatorChart ¶
ResolveVirtFusionOperatorChart returns local path, OCI ref, or empty. Precedence: explicit path/OCI → VIRTFUSION_OPERATOR_CHART → sibling checkout → Harbor OCI default.
func SolusVMCredentialsSecretName ¶
SolusVMCredentialsSecretName matches the chart fullname: {release}-solusvm-operator-solusvm-credentials-{id}.
func UpgradeOperatorRelease ¶ added in v1.0.14
func UpgradeOperatorRelease(ctx context.Context, u OperatorUpgrade, logger Logger) error
UpgradeOperatorRelease upgrades CRDs and the operator chart without rewriting Secrets.
func VerifySHA256File ¶
VerifySHA256File checks that path has the expected hex SHA-256 digest.
func VersionSatisfies ¶
VersionSatisfies reports whether current meets required (or minVersion when required is empty).
func VersionsMap ¶
func VersionsMap(pins *api.PlatformPins) map[string]string
VersionsMap returns a flat name→version map for persistence / diagnostics.
func VirtFusionCredentialsSecretName ¶
VirtFusionCredentialsSecretName matches the chart fullname: {release}-virtfusion-operator-virtfusion-credentials-{id}.
Types ¶
type CalicoConfig ¶
type CalicoConfig struct {
Version string // e.g., "v3.30.2"
RolloutTimeout string // e.g., "10m"
CRDsURL string // URL to Calico CRDs manifest (operator-crds.yaml)
OperatorURL string // URL to Calico operator manifest (tigera-operator.yaml)
CustomResourcesURL string // URL to Calico custom resources manifest (custom-resources.yaml)
PodCIDR string // Calico IPv4 pool CIDR. Must match k3s cluster CIDR.
}
CalicoConfig holds Calico installation configuration
type CalicoInstaller ¶
type CalicoInstaller struct {
// contains filtered or unexported fields
}
CalicoInstaller handles Calico installation using client-go
func NewCalicoInstaller ¶
func NewCalicoInstaller(k8sClient *k8s.Client, config *CalicoConfig, logger Logger) *CalicoInstaller
NewCalicoInstaller creates a new Calico installer
func (*CalicoInstaller) Install ¶
func (c *CalicoInstaller) Install(ctx context.Context) error
Install installs Calico using Kubernetes client-go. Calico remains the provider-cluster CNI (k3s flannel is disabled). Liqo peering does not require matching CNIs across clusters, but the local cluster still needs a CNI for in-cluster pod networking.
When Calico is already present, Install still re-applies networking patches and verifies ClusterIP DNS so resume/--force paths heal a broken CNI dataplane.
type ClusterCleaner ¶
type ClusterCleaner struct {
// contains filtered or unexported fields
}
ClusterCleaner removes local cluster components during deregister/force.
func NewClusterCleaner ¶
func NewClusterCleaner(logger Logger) (*ClusterCleaner, error)
NewClusterCleaner creates a cluster cleaner.
func (*ClusterCleaner) CleanupHostLeftovers ¶ added in v1.0.12
func (c *ClusterCleaner) CleanupHostLeftovers(ctx context.Context) error
CleanupHostLeftovers removes leftover Liqo interfaces after k3s-uninstall (the script does not delete liqo.* devices).
func (*ClusterCleaner) CleanupLiqoTenantLeftovers ¶
func (c *ClusterCleaner) CleanupLiqoTenantLeftovers(ctx context.Context) error
CleanupLiqoTenantLeftovers deletes leftover tenant CRs (and namespaces) that block `liqoctl uninstall` after ForeignClusters were removed but networking objects remain.
func (*ClusterCleaner) CleanupRemotePeeringLeftovers ¶ added in v1.0.12
func (c *ClusterCleaner) CleanupRemotePeeringLeftovers(ctx context.Context, remoteKubeconfig, agentID string) error
CleanupRemotePeeringLeftovers deletes mothership Liqo leftovers for this agent (ForeignCluster, remapped operator/vnc/tenant namespaces) and strips stuck finalizers. Used on --skip-api when DeleteAgent never runs.
func (*ClusterCleaner) ForceCleanupAll ¶
func (c *ClusterCleaner) ForceCleanupAll(ctx context.Context, peeringKubeconfig string) []error
ForceCleanupAll runs best-effort cleanup of Liqo, Calico, and k3s.
func (*ClusterCleaner) UninstallCalico ¶
func (c *ClusterCleaner) UninstallCalico(ctx context.Context) error
UninstallCalico best-effort removes Calico namespaces/resources.
func (*ClusterCleaner) UninstallK3s ¶
func (c *ClusterCleaner) UninstallK3s(ctx context.Context) error
UninstallK3s runs the k3s uninstall script if present.
func (*ClusterCleaner) UninstallLiqo ¶
func (c *ClusterCleaner) UninstallLiqo(ctx context.Context, kubeconfigPath string) error
UninstallLiqo best-effort uninstalls Liqo via liqoctl.
func (*ClusterCleaner) UnoffloadNamespaces ¶
func (c *ClusterCleaner) UnoffloadNamespaces(ctx context.Context) error
UnoffloadNamespaces disables Liqo namespace offloading so uninstall does not hang and a later register is not blocked by a leftover RemoteNamespaceName.
DeleteAgent on the platform only unoffloads the mothership operator namespace. The provider-local offloads (vnc-gateway, pterodactyl-console) live here and must be removed locally.
func (*ClusterCleaner) UnpeerLiqo ¶
func (c *ClusterCleaner) UnpeerLiqo(ctx context.Context, remoteKubeconfig string) error
UnpeerLiqo best-effort unpeers Liqo using liqoctl. remoteKubeconfig is optional; local kubeconfig is always resolved to a user-readable path (k3s.yaml is often mode 600 / root-owned). After liqoctl unpeer, leftover ForeignCluster CRs are deleted — uninstall pre-checks fail while authentication remains enabled on those objects.
func (*ClusterCleaner) WaitForPlatformUnpeer ¶
func (c *ClusterCleaner) WaitForPlatformUnpeer(ctx context.Context) error
WaitForPlatformUnpeer blocks until the platform has removed the ForeignCluster it owns.
DeleteAgent only enqueues that teardown, so continuing immediately races it: while the platform still holds the peering its controllers recreate any ForeignCluster deleted here, and `liqoctl uninstall` refuses to run while one exists. Waiting turns that race into a deterministic handover.
type K3sConfig ¶
type K3sConfig struct {
InstallScriptURL string
KubeconfigMode string
ClusterCIDR string
ServiceCIDR string
FlannelBackend string
InstallDisables string
InstallChannel string
Version string // Exact k3s version tag (INSTALL_K3S_VERSION)
KubeconfigPath string // Path to kubeconfig after installation
NodeIP string
NodeExternalIP string
}
K3sConfig holds k3s installation configuration
type K3sInstaller ¶
type K3sInstaller struct {
// contains filtered or unexported fields
}
K3sInstaller handles k3s installation
func NewK3sInstaller ¶
func NewK3sInstaller(config *K3sConfig, log Logger) (*K3sInstaller, error)
NewK3sInstaller creates a new k3s installer
func (*K3sInstaller) GetK8sClient ¶
func (k *K3sInstaller) GetK8sClient() *k8s.Client
GetK8sClient returns the Kubernetes client (after installation)
func (*K3sInstaller) GetKubeconfigPath ¶
func (k *K3sInstaller) GetKubeconfigPath() string
GetKubeconfigPath returns the kubeconfig path that was actually used. This may be ~/.nr/k3s.kubeconfig when sudo was needed to read k3s.yaml.
type LiqoConfig ¶
type LiqoConfig struct {
Version string
Timeout string
GWServiceType string
GWServerServiceLocation string
PodOffloadingStrategy string
PodCIDR string
ServiceCIDR string
ClusterID string // Cluster/Agent ID for liqoctl install
KubeconfigPath string // Path to kubeconfig file (optional, liqoctl will use default if not provided)
ProxyURL string // Proxy URL for liqo peer command (optional)
APIServerURL string
GWServerServiceNodePort string
GWClientAddress string
GWClientPort string
DisableAPIServerSanityCheck bool
// ChartOCI is the Helm OCI chart reference without version (e.g. oci://harbor.noderings.com/nrings/liqo).
ChartOCI string
// ChartVersion is the Helm chart version (usually Version without a leading v).
ChartVersion string
}
LiqoConfig holds Liqo configuration
type LiqoManager ¶
type LiqoManager struct {
// contains filtered or unexported fields
}
LiqoManager handles Liqo installation, peering, and namespace offloading
func NewLiqoManager ¶
func NewLiqoManager(validator *Validator, k8sClient *k8s.Client, config *LiqoConfig, logger Logger) *LiqoManager
NewLiqoManager creates a new Liqo manager
func (*LiqoManager) GeneratePeeringUser ¶
func (l *LiqoManager) GeneratePeeringUser(ctx context.Context, consumerClusterID, outPath string) error
GeneratePeeringUser runs liqoctl generate peering-user and writes the kubeconfig to outPath.
func (*LiqoManager) GetAPIServerProxyIP ¶ added in v1.0.12
func (l *LiqoManager) GetAPIServerProxyIP(ctx context.Context) (string, error)
GetAPIServerProxyIP returns this cluster's api-server-proxy address as remapped into the local ExternalCIDR. A remote peer reaches it by mapping this address once more, through its own Configuration for this cluster.
func (*LiqoManager) GetPeeredClusterID ¶
func (l *LiqoManager) GetPeeredClusterID(ctx context.Context) (string, error)
GetPeeredClusterID returns the remote Liqo cluster ID from the local agent cluster after peering. It uses liqoctl info peer on the local kubeconfig (not the restricted remote peering-user kubeconfig).
func (*LiqoManager) Install ¶
func (l *LiqoManager) Install(ctx context.Context) error
Install installs Liqo using system liqoctl binary
func (*LiqoManager) IsInstalled ¶
func (l *LiqoManager) IsInstalled(ctx context.Context) bool
IsInstalled reports whether Liqo is present and has a real cluster ID.
func (*LiqoManager) IsPeeringComplete ¶
func (l *LiqoManager) IsPeeringComplete(ctx context.Context) (bool, error)
IsPeeringComplete reports whether liqoctl peer finished (resource slice accepted or virtual node present).
func (*LiqoManager) NeedsPeeringReset ¶
func (l *LiqoManager) NeedsPeeringReset(ctx context.Context) (bool, error)
NeedsPeeringReset reports partial peering that blocks re-peer (e.g. resource slice stuck unaccepted).
func (*LiqoManager) OffloadNamespace ¶
func (l *LiqoManager) OffloadNamespace(ctx context.Context, ns, remoteNamespaceName, namespaceMappingStrategy, selector string) error
OffloadNamespace offloads a namespace to peered clusters CLI manages the entire offloading operation
func (*LiqoManager) Peer ¶
func (l *LiqoManager) Peer(ctx context.Context, kubeconfigPath string, gwServerServicePort string) error
Peer configures and peers clusters using liqoctl. gwServerServicePort is the agent-allocated gateway port: NodePort value when service type is NodePort, otherwise --gw-server-service-port for LoadBalancer. Optional gw-client-* overrides come only from LiqoConfig (NAT edge cases); test-k3d.md-style peer does not set them — the client discovers the NodePort.
func (*LiqoManager) PeerAfterReset ¶
func (*LiqoManager) PrepareGameCatalogReflection ¶ added in v1.0.16
func (l *LiqoManager) PrepareGameCatalogReflection(ctx context.Context) error
PrepareGameCatalogReflection installs the operator CRDs and the Liqo role rules a new virtual-kubelet needs to reflect Pterodactyl resources. Already-installed Liqo does not re-apply its values, so this runs on every install, including the skip path.
func (*LiqoManager) ResetPartialPeering ¶
func (l *LiqoManager) ResetPartialPeering(ctx context.Context, remoteKubeconfigPath string)
ResetPartialPeering tears down incomplete peering state on local and remote clusters. Partial runs often leave nonce secrets or tenant namespaces that block the next peer.
func (*LiqoManager) ResolveInboundAPIServerProxyURL ¶ added in v1.0.12
func (l *LiqoManager) ResolveInboundAPIServerProxyURL( ctx context.Context, remoteKubeconfigPath, localClusterID string, ) (string, error)
ResolveInboundAPIServerProxyURL returns the HTTP CONNECT proxy URL a remote cluster must use to reach this cluster's Kubernetes API server through the Liqo tunnel.
The address is mapped twice: once by this cluster into its own ExternalCIDR, and once by the remote cluster, whose Configuration records how it remapped that CIDR. remoteKubeconfigPath must point at the remote cluster, and localClusterID identifies this cluster there.
type Logger ¶
type Logger interface {
Info(args ...any)
Infof(format string, args ...any)
Warn(args ...any)
Warnf(format string, args ...any)
Error(args ...any)
Errorf(format string, args ...any)
Debug(args ...any)
Debugf(format string, args ...any)
}
Logger interface for install components
type OperatorUpgrade ¶ added in v1.0.14
type OperatorUpgrade struct {
Driver string
Chart string
ChartVersion string
ImageTag string
ImageRegistry string
ImageRepository string
Release string
Namespace string
VNCGatewayNamespace string
VNCGatewayImageTag string
VNCGatewayImageRepository string
KubeconfigPath string
Workloads []string
VNCDeployment string
}
OperatorUpgrade is a Helm in-place upgrade of an already-installed operator. It keeps hypervisor credentials in existing Secrets and Helm values.
func NewOperatorUpgrade ¶ added in v1.0.14
func NewOperatorUpgrade(driver, kubeconfig, chart, version string) (OperatorUpgrade, error)
NewOperatorUpgrade builds an in-place upgrade from CLI pins for driver.
func (*OperatorUpgrade) BindLiveRelease ¶ added in v1.0.14
func (u *OperatorUpgrade) BindLiveRelease(release, namespace string) error
BindLiveRelease pins the upgrade to the Helm release DetectReusableOperator found and refreshes workload names for that release.
func (OperatorUpgrade) Validate ¶ added in v1.0.14
func (u OperatorUpgrade) Validate() error
Validate reports whether the upgrade can be applied.
type ProxmoxInstance ¶
type ProxmoxInstance struct {
ID string `yaml:"id" json:"id"`
URL string `yaml:"url" json:"url"`
Username string `yaml:"username" json:"username"`
TokenID string `yaml:"tokenId" json:"tokenId"`
TokenSecret string `yaml:"tokenSecret" json:"tokenSecret"`
}
ProxmoxInstance holds one Proxmox API endpoint + token (user-supplied secrets).
func LoadProxmoxInstancesFile ¶
func LoadProxmoxInstancesFile(path string) ([]ProxmoxInstance, error)
LoadProxmoxInstancesFile reads a YAML file with either:
instances: [ { id, url, username, tokenId, tokenSecret }, ... ]
or a bare list of instances.
func ProxmoxInstanceFromEnv ¶
func ProxmoxInstanceFromEnv() (*ProxmoxInstance, error)
ProxmoxInstanceFromEnv builds a single instance from PROXMOX_* env vars (test-k3d compat). Returns nil, nil when none of the required vars are set.
func (ProxmoxInstance) Validate ¶
func (p ProxmoxInstance) Validate() error
Validate checks required fields for one instance.
type ProxmoxOperatorConfig ¶
type ProxmoxOperatorConfig struct {
ChartPath string
ChartVersion string
HelmNamespace string
HelmRelease string
VNCGatewayNamespace string
Instances []ProxmoxInstance
MimirBearerToken string
MimirServiceEndpoint string
// MimirTLSEnabled selects https vs http for alloy.mimir.serviceEndpoint.
// Production (metrics.noderings.com) uses true; local control-plane Mimir uses false.
MimirTLSEnabled bool
// AgentID is stamped onto Alloy remote_write external_labels as agent_id.
AgentID string
VNCGatewayImageTag string
VNCTLSServerName string
VNCCAFile string
KubeconfigPath string
}
ProxmoxOperatorConfig holds inputs for provider-side operator + vnc-gateway install.
func BaseConfigFromEnv ¶
func BaseConfigFromEnv(kubeconfigPath string) *ProxmoxOperatorConfig
BaseConfigFromEnv fills non-secret defaults from environment (same knobs as install-proxmox-operator-provider.sh).
type ProxmoxOperatorInstaller ¶
type ProxmoxOperatorInstaller struct {
// contains filtered or unexported fields
}
ProxmoxOperatorInstaller installs proxmox-operator via helm subprocess.
func NewProxmoxOperatorInstaller ¶
func NewProxmoxOperatorInstaller(cfg *ProxmoxOperatorConfig, logger Logger) *ProxmoxOperatorInstaller
NewProxmoxOperatorInstaller creates an installer.
type ReusableOperator ¶ added in v1.0.14
ReusableOperator is a live Helm release whose instance Secrets still exist.
func DetectReusableOperator ¶ added in v1.0.14
func DetectReusableOperator(ctx context.Context, kubeconfig, driver string) (*ReusableOperator, error)
DetectReusableOperator returns the live operator Helm release when instance Secrets exist.
type SolusVMInstance ¶
type SolusVMInstance struct {
ID string `yaml:"id" json:"id"`
URL string `yaml:"url" json:"url"`
Token string `yaml:"token" json:"token"`
}
SolusVMInstance holds one SolusVM 2 management-node API endpoint + bearer token.
func LoadSolusVMInstancesFile ¶
func LoadSolusVMInstancesFile(path string) ([]SolusVMInstance, error)
LoadSolusVMInstancesFile reads a YAML file with either:
instances: [ { id, url, token }, ... ]
or a bare list of instances. The file must be mode 0600.
func SolusVMInstanceFromEnv ¶
func SolusVMInstanceFromEnv() (*SolusVMInstance, error)
SolusVMInstanceFromEnv builds a single instance from SOLUSVM_* env vars. Returns nil, nil when none of the required vars are set.
func (SolusVMInstance) Validate ¶
func (v SolusVMInstance) Validate() error
Validate checks required fields for one SolusVM 2 instance.
type SolusVMOperatorConfig ¶
type SolusVMOperatorConfig struct {
ChartPath string
ChartVersion string
HelmNamespace string
HelmRelease string
VNCGatewayNamespace string
Instances []SolusVMInstance
MimirBearerToken string
MimirServiceEndpoint string
// MimirTLSEnabled selects https vs http for alloy.mimir.serviceEndpoint.
MimirTLSEnabled bool
// AgentID is stamped onto Alloy remote_write external_labels as agent_id.
AgentID string
VNCGatewayImageTag string
KubeconfigPath string
}
SolusVMOperatorConfig holds inputs for provider-side SolusVM operator + vnc-gateway install.
func SolusVMBaseConfigFromEnv ¶
func SolusVMBaseConfigFromEnv(kubeconfigPath string) *SolusVMOperatorConfig
SolusVMBaseConfigFromEnv fills non-secret defaults from environment. HelmNamespace is solusvm-system unless HELM_NAMESPACE is explicitly set.
type SolusVMOperatorInstaller ¶
type SolusVMOperatorInstaller struct {
// contains filtered or unexported fields
}
SolusVMOperatorInstaller installs solusvm-operator via helm subprocess.
func NewSolusVMOperatorInstaller ¶
func NewSolusVMOperatorInstaller(cfg *SolusVMOperatorConfig, logger Logger) *SolusVMOperatorInstaller
NewSolusVMOperatorInstaller creates a SolusVM operator installer.
type SudoManager ¶
type SudoManager struct {
// contains filtered or unexported fields
}
SudoManager handles sudo authentication and command execution
func NewSudoManager ¶
func NewSudoManager(logger Logger) (*SudoManager, error)
NewSudoManager creates a new sudo manager and authenticates once
func (*SudoManager) PrepareStdin ¶
func (sm *SudoManager) PrepareStdin(additionalData []byte) io.Reader
PrepareStdin prepares stdin for a command After initial authentication, sudo -n doesn't need password input
func (*SudoManager) RunCommand ¶
RunCommand runs a command with sudo if needed Uses sudo -n -E (non-interactive, preserve environment) after initial authentication
type SystemCheckResult ¶
type SystemCheckResult struct {
Check string
Status string // "pass" | "fail" | "warn"
Message string
}
SystemCheckResult represents the result of a system check
type SystemValidator ¶
type SystemValidator struct {
// contains filtered or unexported fields
}
SystemValidator performs pre-flight system checks
func NewSystemValidator ¶
func NewSystemValidator(logger Logger) *SystemValidator
NewSystemValidator creates a new system validator
func (*SystemValidator) ValidateSystem ¶
func (v *SystemValidator) ValidateSystem(ctx context.Context, agentIP string) ([]SystemCheckResult, error)
ValidateSystem checks system requirements. agentIP is --agent-ip; it must be assigned to a local interface because k3s is started with --node-ip from that value.
func (*SystemValidator) ValidateTempDir ¶
func (v *SystemValidator) ValidateTempDir(tempDir string) error
ValidateTempDir checks if temp directory is writable
type ToolBootstrapper ¶
type ToolBootstrapper struct {
// contains filtered or unexported fields
}
ToolBootstrapper downloads and installs CLI-managed tools (helm, liqoctl).
func NewToolBootstrapper ¶
func NewToolBootstrapper(verifyChecksums bool, logger Logger) (*ToolBootstrapper, error)
NewToolBootstrapper creates a bootstrapper that installs into ~/.nr/bin.
func (*ToolBootstrapper) BootstrapTools ¶
func (t *ToolBootstrapper) BootstrapTools(ctx context.Context, pins *api.PlatformPins) error
BootstrapTools ensures helm and liqoctl match the given platform pins.
type ToolRequirement ¶
type ToolRequirement struct {
Name string
MinVersion string
Optional bool
InstallURL string
VersionFlag string // Flag to get version (e.g., "--version", "version")
}
ToolRequirement defines a requirement for an external tool
type ValidationResult ¶
type ValidationResult struct {
Tool string
Available bool
Version string
Valid bool
Error error
Requirement *ToolRequirement
}
ValidationResult represents the result of validating a tool
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates prerequisites
func NewToolValidator ¶
func NewToolValidator(pins *api.PlatformPins, cfg *config.Config) *Validator
NewToolValidator builds a validator using server pins when available. After preparePlatformVersions, cfg.Liqo holds the same fork pin as liqoctl.
func NewValidator ¶
func NewValidator() *Validator
NewValidator creates a new prerequisites validator with offline-safe defaults. Prefer NewToolValidator so liqoctl/helm floors come from /v1/platform-versions.
func (*Validator) CheckTool ¶
CheckTool checks if a tool is available (public method for compatibility)
func (*Validator) PrintResults ¶
func (v *Validator) PrintResults(results []ValidationResult) error
PrintResults prints validation results
func (*Validator) SetMinVersion ¶
SetMinVersion updates the minimum version for a known tool (e.g. from server pins).
func (*Validator) ValidatePrerequisites ¶
func (v *Validator) ValidatePrerequisites(ctx context.Context) ([]ValidationResult, error)
ValidatePrerequisites validates all required tools
type VersionChecker ¶
type VersionChecker struct{}
VersionChecker checks and compares tool versions
func NewVersionChecker ¶
func NewVersionChecker() *VersionChecker
NewVersionChecker creates a new version checker
func (*VersionChecker) CompareVersions ¶
func (v *VersionChecker) CompareVersions(current, minimum string) (int, error)
CompareVersions compares two semantic versions Returns: -1 if current < minimum, 0 if equal, 1 if current >= minimum
func (*VersionChecker) ExtractVersion ¶
func (v *VersionChecker) ExtractVersion(versionOutput string) (string, error)
ExtractVersion extracts a semantic version from tool output Handles various output formats like: - "v1.2.3" - "1.2.3" - "tool version 1.2.3" - "tool 1.2.3 (build abc123)"
func (*VersionChecker) MeetsMinimum ¶
func (v *VersionChecker) MeetsMinimum(current, minimum string) (bool, error)
MeetsMinimum checks if current version meets minimum requirement
type VirtFusionInstance ¶
type VirtFusionInstance struct {
ID string `yaml:"id" json:"id"`
URL string `yaml:"url" json:"url"`
Token string `yaml:"token" json:"token"`
UserAPIToken string `yaml:"userApiToken" json:"userApiToken"`
UserID int `yaml:"userId" json:"userId"`
UserName string `yaml:"userName" json:"userName"`
}
VirtFusionInstance holds one VirtFusion control-plane endpoint plus Global and User API credentials.
func LoadVirtFusionInstancesFile ¶
func LoadVirtFusionInstancesFile(path string) ([]VirtFusionInstance, error)
LoadVirtFusionInstancesFile reads a YAML file with either:
instances: [ { id, url, token, userApiToken, userId, userName }, ... ]
or a bare list of instances. The file must be mode 0600.
func VirtFusionInstanceFromEnv ¶
func VirtFusionInstanceFromEnv() (*VirtFusionInstance, error)
VirtFusionInstanceFromEnv builds a single instance from VIRTFUSION_* env vars. Returns nil, nil when none of the required vars are set.
func (VirtFusionInstance) Validate ¶
func (v VirtFusionInstance) Validate() error
Validate checks required fields for one VirtFusion instance.
type VirtFusionOperatorConfig ¶
type VirtFusionOperatorConfig struct {
ChartPath string
ChartVersion string
HelmNamespace string
HelmRelease string
VNCGatewayNamespace string
Instances []VirtFusionInstance
MimirBearerToken string
MimirServiceEndpoint string
// MimirTLSEnabled selects https vs http for alloy.mimir.serviceEndpoint.
MimirTLSEnabled bool
// AgentID is stamped onto Alloy remote_write external_labels as agent_id.
AgentID string
VNCGatewayImageTag string
KubeconfigPath string
}
VirtFusionOperatorConfig holds inputs for provider-side VirtFusion operator + vnc-gateway install.
func VirtFusionBaseConfigFromEnv ¶
func VirtFusionBaseConfigFromEnv(kubeconfigPath string) *VirtFusionOperatorConfig
VirtFusionBaseConfigFromEnv fills non-secret defaults from environment. HelmNamespace is virtfusion-system unless HELM_NAMESPACE is explicitly set.
type VirtFusionOperatorInstaller ¶
type VirtFusionOperatorInstaller struct {
// contains filtered or unexported fields
}
VirtFusionOperatorInstaller installs virtfusion-operator via helm subprocess.
func NewVirtFusionOperatorInstaller ¶
func NewVirtFusionOperatorInstaller(cfg *VirtFusionOperatorConfig, logger Logger) *VirtFusionOperatorInstaller
NewVirtFusionOperatorInstaller creates a VirtFusion operator installer.
Source Files
¶
- calico.go
- calico_api.go
- helm_cli.go
- hypervisor_crds.go
- hypervisor_url.go
- k3s.go
- kubeconfig.go
- liqo.go
- liqo_api_server_proxy.go
- liqo_nodes.go
- liqo_offload.go
- liqo_peering_status.go
- liqo_values.go
- operator_upgrade.go
- prerequisites.go
- proxmox_instances.go
- proxmox_operator.go
- pterodactyl_reflection.go
- solusvm_instances.go
- solusvm_operator.go
- sudo.go
- tools.go
- uninstall.go
- validator.go
- validator_ip.go
- validator_unix.go
- versions.go
- virtfusion_instances.go
- virtfusion_operator.go
- vnc_gateway_image.go