k4p

package
v0.1.2-0...-df60a3f Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	NodeUsername string           `json:"nodeUsername" yaml:"nodeUsername"`
	NodePassword string           `json:"nodePassword" yaml:"nodePassword"`
	Features     []Feature        `json:"features" yaml:"features"`
	NodeDiskSize uint16           `json:"nodeDiskSize" yaml:"nodeDiskSize"`
	Nodes        []KubernetesNode `json:"nodes" yaml:"nodes"`
	Network      Network          `json:"network" yaml:"network"`
}

type Feature

type Feature struct {
	Name                       string `json:"name"`
	Args                       string `json:"args"`
	KubernetesObjectDefinition string `json:"kubernetesObjectDefinition"`
}

type JoinNode

type JoinNode struct {
	Token string   `json:"token"`
	Urls  []string `json:"urls"`
}

type KubernetesNode

type KubernetesNode struct {
	Name        string   `json:"name" yaml:"name"`
	Vmid        uint32   `json:"vmid" yaml:"vmid"`
	Cores       uint16   `json:"cores" yaml:"cores"`
	Memory      uint16   `json:"memory" yaml:"memory"`
	IpAddress   string   `json:"ipAddress" yaml:"ipAddress"`
	StoragePool string   `json:"storagePool" yaml:"storagePool"`
	NodeType    NodeType `json:"nodeType" yaml:"nodeType"`
}

type Network

type Network struct {
	Gateway    string `json:"gateway" yaml:"gateway"`
	SubnetMask uint8  `json:"subnetMask" yaml:"subnetMask"`
	DnsServer  string `json:"dnsServer" yaml:"dnsServer"`
	Bridge     string `json:"bridge" yaml:"bridge"`
}

type NodeType

type NodeType string
const Master NodeType = "master"
const Worker NodeType = "worker"

type ProvisionRequest

type ProvisionRequest struct {
	Stages ProvisionStage `json:"stages"`
	// This declaration is ugly hack - Wails has problem with generating models when are in different packages - to fix later
	NotUsed Cluster `json:"notUsed"`
}

type ProvisionStage

type ProvisionStage struct {
	CreateVirtualMachines bool `json:"createVirtualMachines"`
	InstallKubernetes     bool `json:"installKubernetes"`
	JoinNodesToCluster    bool `json:"joinNodesToCluster"`
	InstallFeatures       bool `json:"installFeatures"`
}

type Service

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

func NewK4PService

func NewK4PService(
	proxmoxClient *proxmox.Client,
	proxmoxSsh *ssh.Client,
	eventCollector *event.Collector) *Service

func (*Service) ClearEvents

func (k *Service) ClearEvents() int

func (*Service) CreateVirtualMachines

func (k *Service) CreateVirtualMachines(provisionRequest Cluster, keyPair ssh.RsaKeyPair) error

func (*Service) GetEvents

func (k *Service) GetEvents() []event.Event

func (*Service) GetKubeConfigFromCluster

func (k *Service) GetKubeConfigFromCluster(clusterDef Cluster, keyPair ssh.RsaKeyPair) (string, error)

func (*Service) InstallFeatures

func (k *Service) InstallFeatures(provisionRequest Cluster, keyPair ssh.RsaKeyPair) error

func (*Service) InstallKubernetes

func (k *Service) InstallKubernetes(provisionRequest Cluster, keyPair ssh.RsaKeyPair) error

func (*Service) JoinNodesToCluster

func (k *Service) JoinNodesToCluster(provisionRequest Cluster, keyPair ssh.RsaKeyPair) error

func (*Service) SetupEnvironmentOnProxmox

func (k *Service) SetupEnvironmentOnProxmox() error

func (*Service) ShutdownVirtualMachines

func (k *Service) ShutdownVirtualMachines(cluster Cluster) error

func (*Service) StartVirtualMachines

func (k *Service) StartVirtualMachines(cluster Cluster, keyPair ssh.RsaKeyPair) error

func (*Service) UpdateVmOs

func (k *Service) UpdateVmOs(provisionRequest Cluster, keyPair ssh.RsaKeyPair) error

Jump to

Keyboard shortcuts

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