node

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateClusterIP

func CalculateClusterIP(clusterName, nodeName string) string

func CalculateClusterIPExcluding

func CalculateClusterIPExcluding(clusterName, nodeName string, usedIPs []string) string

func CalculateClusterMAC

func CalculateClusterMAC(clusterName, nodeName string) string

Types

type CloudInitData

type CloudInitData struct {
	NodeName         string
	ClusterIP        string
	DNSIP            string
	SSHUser          string
	SSHPubKey        string
	ClusterDomain    string
	UpstreamDNS1     string
	UpstreamDNS2     string
	RegistryStaticIP string
	RegistryPort     int
	RegistryHostname string
	ServiceCIDR      string
}

type Node

type Node struct {
	Name                string
	ContainerName       string
	ClusterName         string
	ClusterIP           string
	ClusterMAC          string
	DNSIP               string
	IsControlPlane      bool
	Memory              int
	MaxMemory           int
	VCPUs               int
	BaseDisk            string
	NodeImage           string
	ClusterImagesVolume string
	APIPort             int // Configured API port (0 = auto-assign)
	AssignedAPIPort     int // Actual assigned port after container creation
	// contains filtered or unexported fields
}

func New

func New(name string, isControlPlane bool, opts ...NodeOption) (*Node, error)

func (*Node) Cleanup

func (n *Node) Cleanup() error

func (*Node) Create

func (n *Node) Create(ctx context.Context) error

func (*Node) Exists

func (n *Node) Exists(ctx context.Context) (bool, error)

type NodeOption

type NodeOption func(*Node) error

func WithAPIPort

func WithAPIPort(port int) NodeOption

func WithClusterImagesVolume

func WithClusterImagesVolume(volumeName string) NodeOption

func WithClusterName

func WithClusterName(name string) NodeOption

func WithDNSIP

func WithDNSIP(ip string) NodeOption

func WithMaxMemory

func WithMaxMemory(maxMemory int) NodeOption

func WithMemory

func WithMemory(memory int) NodeOption

func WithNodeImage

func WithNodeImage(image string) NodeOption

func WithUsedIPs

func WithUsedIPs(ips []string) NodeOption

Jump to

Keyboard shortcuts

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