config

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HomeDir, _          = os.UserHomeDir()
	RootDir             = path.Join(HomeDir, ".kubefire")
	ClusterRootDir      = path.Join(RootDir, "clusters")
	BinDir              = path.Join(RootDir, "bin")
	BootstrapperRootDir = path.Join(RootDir, "bootstrappers")
)

Functions

This section is empty.

Types

type BaseBootstrapperVersion added in v0.3.4

type BaseBootstrapperVersion struct {
	BootstrapperVersion string `json:"version"`
	BootstrapperType    string `json:"type"`
}

func (*BaseBootstrapperVersion) Display added in v0.3.4

func (b *BaseBootstrapperVersion) Display() string

func (*BaseBootstrapperVersion) LocalVersionFile added in v0.3.4

func (b *BaseBootstrapperVersion) LocalVersionFile() string

func (*BaseBootstrapperVersion) Type added in v0.3.4

func (b *BaseBootstrapperVersion) Type() string

func (*BaseBootstrapperVersion) Version added in v0.3.4

func (b *BaseBootstrapperVersion) Version() string

type BootstrapperVersioner added in v0.2.0

type BootstrapperVersioner interface {
	Type() string
	LocalVersionFile() string
	Version() string
	Display() string
}

func NewBootstrapperVersion added in v0.2.0

func NewBootstrapperVersion(bootstrapperType string, version string) BootstrapperVersioner

type Cluster

type Cluster struct {
	Name         string `json:"name"`
	Bootstrapper string `json:"bootstrapper"`
	Pubkey       string `json:"pubkey"`
	Prikey       string `json:"prikey"`
	Version      string `json:"version"`

	Image       string `json:"image"`
	KernelImage string `json:"kernel_image,omitempty"`
	KernelArgs  string `json:"kernel_args,omitempty"`

	ExtraOptions map[string]interface{} `json:"extra_options"`
	Deployed     bool                   `json:"deployed"` // the only status property

	Master Node `json:"master"`
	Worker Node `json:"worker"`
}

func NewCluster

func NewCluster() *Cluster

func NewDefaultCluster added in v0.3.0

func NewDefaultCluster() *Cluster

func (*Cluster) LocalClusterConfigFile

func (c *Cluster) LocalClusterConfigFile() string

func (*Cluster) LocalClusterDir

func (c *Cluster) LocalClusterDir() string

func (*Cluster) LocalClusterKeyFiles

func (c *Cluster) LocalClusterKeyFiles() (string, string)

func (*Cluster) LocalKubeConfig

func (c *Cluster) LocalKubeConfig() string

func (*Cluster) ParseExtraOptions

func (c *Cluster) ParseExtraOptions(options interface{}) error

func (*Cluster) UpdateExtraOptions added in v0.3.0

func (c *Cluster) UpdateExtraOptions(options string)

type K0sBootstrapperVersion added in v0.3.4

type K0sBootstrapperVersion struct {
	BaseBootstrapperVersion
}

func NewK0sBootstrapperVersion added in v0.3.4

func NewK0sBootstrapperVersion(bootstrapperVersion string) *K0sBootstrapperVersion

type K3sBootstrapperVersion added in v0.2.0

type K3sBootstrapperVersion struct {
	BaseBootstrapperVersion
}

func NewK3sBootstrapperVersion added in v0.2.0

func NewK3sBootstrapperVersion(bootstrapperVersion string) *K3sBootstrapperVersion

type KubeadmBootstrapperVersion added in v0.2.0

type KubeadmBootstrapperVersion struct {
	BaseBootstrapperVersion

	CrictlVersion      string `json:"crictl_version"`
	KubeReleaseVersion string `json:"kube_release_version"`
}

func NewKubeadmBootstrapperVersion added in v0.2.0

func NewKubeadmBootstrapperVersion(bootstrapperVersion string, crictlVersion string, kubeReleaseVersion string) *KubeadmBootstrapperVersion

type LocalConfigManager

type LocalConfigManager struct {
}

func NewLocalConfigManager

func NewLocalConfigManager() *LocalConfigManager

func (*LocalConfigManager) DeleteBootstrapperVersions added in v0.2.0

func (l *LocalConfigManager) DeleteBootstrapperVersions(latestVersion BootstrapperVersioner) error

func (*LocalConfigManager) DeleteCluster

func (l *LocalConfigManager) DeleteCluster(cluster *Cluster) error

func (*LocalConfigManager) GetBootstrapperVersions added in v0.2.0

func (l *LocalConfigManager) GetBootstrapperVersions(latestVersion BootstrapperVersioner) ([]BootstrapperVersioner, error)

func (*LocalConfigManager) GetCluster

func (l *LocalConfigManager) GetCluster(name string) (*Cluster, error)

func (*LocalConfigManager) ListClusters

func (l *LocalConfigManager) ListClusters() ([]*Cluster, error)

func (*LocalConfigManager) SaveBootstrapperVersions added in v0.2.0

func (l *LocalConfigManager) SaveBootstrapperVersions(latestVersion BootstrapperVersioner, versions []BootstrapperVersioner) error

func (*LocalConfigManager) SaveCluster

func (l *LocalConfigManager) SaveCluster(cluster *Cluster) error

type Manager

type Manager interface {
	SaveCluster(cluster *Cluster) error
	DeleteCluster(cluster *Cluster) error
	GetCluster(name string) (*Cluster, error)
	ListClusters() ([]*Cluster, error)

	SaveBootstrapperVersions(latestVersion BootstrapperVersioner, versions []BootstrapperVersioner) error
	GetBootstrapperVersions(latestVersion BootstrapperVersioner) ([]BootstrapperVersioner, error)
	DeleteBootstrapperVersions(latestVersion BootstrapperVersioner) error
}

type Node

type Node struct {
	Count    int      `json:"count"`
	Memory   string   `json:"memory,omitempty"`
	Cpus     int      `json:"cpus,omitempty"`
	DiskSize string   `json:"disk_size,omitempty"`
	Cluster  *Cluster `json:"-"`
}

type RKE2BootstrapperVersion added in v0.3.4

type RKE2BootstrapperVersion struct {
	BaseBootstrapperVersion
}

func NewRKE2BootstrapperVersion added in v0.3.4

func NewRKE2BootstrapperVersion(bootstrapperVersion string) *RKE2BootstrapperVersion

type RKEBootstrapperVersion added in v0.3.3

type RKEBootstrapperVersion struct {
	BaseBootstrapperVersion
	KubernetesVersions []string `json:"kubernetes_versions"`
}

func NewRKEBootstrapperVersion added in v0.3.3

func NewRKEBootstrapperVersion(bootstrapperVersion string, kubernetesVersions []string) *RKEBootstrapperVersion

func (*RKEBootstrapperVersion) Display added in v0.3.3

func (s *RKEBootstrapperVersion) Display() string

type RancherdBootstrapperVersion added in v0.3.5

type RancherdBootstrapperVersion struct {
	BaseBootstrapperVersion
}

func NewRancherdBootstrapperVersion added in v0.3.5

func NewRancherdBootstrapperVersion(bootstrapperVersion string) *RancherdBootstrapperVersion

Jump to

Keyboard shortcuts

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