config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: Apache-2.0 Imports: 17 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 BootstrapperVersioner added in v0.2.0

type BootstrapperVersioner interface {
	Type() string
	LocalVersionFile() string
	Version() 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 K3sBootstrapperVersion added in v0.2.0

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

func NewK3sBootstrapperVersion added in v0.2.0

func NewK3sBootstrapperVersion(bootstrapperVersion string) *K3sBootstrapperVersion

func (*K3sBootstrapperVersion) LocalVersionFile added in v0.2.0

func (k *K3sBootstrapperVersion) LocalVersionFile() string

func (*K3sBootstrapperVersion) Type added in v0.2.0

func (k *K3sBootstrapperVersion) Type() string

func (*K3sBootstrapperVersion) Version added in v0.2.0

func (k *K3sBootstrapperVersion) Version() string

type KubeadmBootstrapperVersion added in v0.2.0

type KubeadmBootstrapperVersion struct {
	BootstrapperVersion string `json:"version"`
	BootstrapperType    string `json:"type"`
	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

func (*KubeadmBootstrapperVersion) LocalVersionFile added in v0.2.0

func (k *KubeadmBootstrapperVersion) LocalVersionFile() string

func (*KubeadmBootstrapperVersion) Type added in v0.2.0

func (*KubeadmBootstrapperVersion) Version added in v0.2.0

func (k *KubeadmBootstrapperVersion) Version() string

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 SkubaBootstrapperVersion added in v0.2.0

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

func NewSkubaBootstrapperVersion added in v0.2.0

func NewSkubaBootstrapperVersion(bootstrapperVersion string) *SkubaBootstrapperVersion

func (*SkubaBootstrapperVersion) LocalVersionFile added in v0.2.0

func (s *SkubaBootstrapperVersion) LocalVersionFile() string

func (*SkubaBootstrapperVersion) Type added in v0.2.0

func (s *SkubaBootstrapperVersion) Type() string

func (*SkubaBootstrapperVersion) Version added in v0.2.0

func (s *SkubaBootstrapperVersion) Version() string

Jump to

Keyboard shortcuts

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