k4p

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 License: MIT Imports: 14 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"`
	MicroK8sAddons     []MicroK8sAddon     `json:"microK8SAddons" yaml:"microK8SAddons"`
	HelmApps           []HelmApp           `json:"helmApps" yaml:"helmApps"`
	CustomHelmApps     []HelmApp           `json:"customHelmApps" yaml:"customHelmApps"`
	CustomK8sResources []CustomK8sResource `json:"customK8SResources" yaml:"customK8SResources"`
	NodeDiskSize       uint16              `json:"nodeDiskSize" yaml:"nodeDiskSize"`
	Nodes              []KubernetesNode    `json:"nodes" yaml:"nodes"`
	Network            Network             `json:"network" yaml:"network"`
}

type CustomK8sResource added in v0.4.0

type CustomK8sResource struct {
	Name    string `json:"name" yaml:"name"`
	Content string `json:"content" yaml:"content"`
}

type HelmApp added in v0.4.0

type HelmApp struct {
	ChartName              string            `json:"chartName" yaml:"chartName"`
	Repository             string            `json:"repository" yaml:"repository"`
	ReleaseName            string            `json:"releaseName" yaml:"releaseName"`
	Namespace              string            `json:"namespace" yaml:"namespace"`
	Parameters             map[string]string `json:"parameters" yaml:"parameters"`
	AdditionalK8sResources []string          `json:"additionalK8SResources" yaml:"additionalK8SResources"`
	ValueFileContent       string            `json:"valueFileContent" yaml:"valueFileContent"`
	ProjectParams          map[string]string `json:"projectParams" yaml:"projectParams"`
}

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 MicroK8sAddon added in v0.4.0

type MicroK8sAddon struct {
	Name                   string   `json:"name" yaml:"name"`
	Args                   string   `json:"args" yaml:"args"`
	AdditionalK8sResources []string `json:"additionalK8SResources" yaml:"additionalK8SResources"`
}

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"`
	SetupVirtualMachines      bool `json:"setupVirtualMachines"`
	InstallKubernetes         bool `json:"installKubernetes"`
	JoinNodesToCluster        bool `json:"joinNodesToCluster"`
	InstallAddons             bool `json:"installAddons"`
	InstallHelpApps           bool `json:"installHelpApps"`
	InstallCustomHelmApps     bool `json:"installCustomHelmApps"`
	InstallCustomK8sResources bool `json:"installCustomK8SResources"`
}

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) InstallAdditionalK8sResources added in v0.4.0

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

func (*Service) InstallAddons added in v0.4.0

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

func (*Service) InstallCustomHelmApps added in v0.4.0

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

func (*Service) InstallHelmApps added in v0.4.0

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

func (*Service) InstallKubernetesOnNodes added in v0.2.0

func (k *Service) InstallKubernetesOnNodes(cluster 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) SetupVmsOs added in v0.3.0

func (k *Service) SetupVmsOs(provisionRequest Cluster, keyPair ssh.RsaKeyPair) 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) UpdateVmsOs added in v0.2.0

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

Jump to

Keyboard shortcuts

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