clustersconfig

package
v0.0.0-...-5c432e3 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug = false

Debug enables debug logs from this package.

Functions

This section is empty.

Types

type CertRequest

type CertRequest struct {
	Template `yaml:",inline"`

	CA      string
	Profile string
	Label   string
	PerHost bool `yaml:"per_host"`
}

type Cluster

type Cluster struct {
	WithRev

	Name        string
	Labels      map[string]string
	Annotations map[string]string

	Domain        string
	Addons        string
	BootstrapPods string `yaml:"bootstrap_pods"`
	Subnets       struct {
		Services string
		Pods     string
	}
	Vars Vars
}

Cluster represents a cluster of hosts, allowing for cluster-wide variables.

func (*Cluster) DNSSvcIP

func (c *Cluster) DNSSvcIP() net.IP

func (*Cluster) KubernetesSvcIP

func (c *Cluster) KubernetesSvcIP() net.IP

func (*Cluster) NthSvcIP

func (c *Cluster) NthSvcIP(n byte) net.IP

type Config

type Config struct {
	Hosts         []*Host
	Groups        []*Group
	Clusters      []*Cluster
	Configs       []*Template
	StaticPods    []*Template            `yaml:"static_pods"`
	BootstrapPods map[string][]*Template `yaml:"bootstrap_pods"`
	Addons        map[string][]*Template
	SSLConfig     string         `yaml:"ssl_config"`
	CertRequests  []*CertRequest `yaml:"cert_requests"`
}

func FromBytes

func FromBytes(data []byte) (*Config, error)

func FromDir

func FromDir(dirPath, defaultsPath string) (*Config, error)

func FromFile

func FromFile(path string) (*Config, error)

func (*Config) CSR

func (c *Config) CSR(name string) *CertRequest

func (*Config) Cluster

func (c *Config) Cluster(name string) *Cluster

func (*Config) ConfigTemplate

func (c *Config) ConfigTemplate(name string) *Template

func (*Config) Group

func (c *Config) Group(name string) *Group

func (*Config) Host

func (c *Config) Host(name string) *Host

func (*Config) HostByIP

func (c *Config) HostByIP(ip string) *Host

func (*Config) HostByMAC

func (c *Config) HostByMAC(mac string) *Host

func (*Config) SaveTo

func (c *Config) SaveTo(path string) error

func (*Config) StaticPodsTemplate

func (c *Config) StaticPodsTemplate(name string) *Template

type Defaults

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

func NewDefaults

func NewDefaults(path string) (d *Defaults, err error)

func (*Defaults) List

func (d *Defaults) List(rev, dir string) (names []string, err error)

func (*Defaults) Load

func (d *Defaults) Load(dir, suffix string, value Rev, data []byte) (err error)

func (*Defaults) Open

func (d *Defaults) Open(rev, filePath string) (rd io.Reader, err error)

func (*Defaults) ReadAll

func (d *Defaults) ReadAll(rev, filePath string) (ba []byte, err error)

type Group

type Group struct {
	WithRev

	Name        string
	Labels      map[string]string
	Annotations map[string]string

	Master          bool
	IPXE            string
	Kernel          string
	Initrd          string
	BootstrapConfig string `yaml:"bootstrap_config"`
	Config          string
	StaticPods      string `yaml:"static_pods"`
	Versions        map[string]string
	Vars            Vars
}

Group represents a group of hosts and provides their configuration.

type Host

type Host struct {
	WithRev

	Name        string
	Labels      map[string]string
	Annotations map[string]string

	MAC     string
	IP      string
	IPs     []string
	Cluster string
	Group   string
	Vars    Vars
}

Host represents a host served by this server.

type Rev

type Rev interface {
	Rev() string
	SetRev(rev string)
}

type Template

type Template struct {
	Name     string
	Template string
	// contains filtered or unexported fields
}

func (*Template) Execute

func (t *Template) Execute(contextName, elementName string, wr io.Writer, data interface{}, extraFuncs map[string]interface{}) error

type Vars

type Vars map[string]interface{}

Vars store user-defined key-values

type WithRev

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

func (*WithRev) Rev

func (r *WithRev) Rev() string

func (*WithRev) SetRev

func (r *WithRev) SetRev(rev string)

Jump to

Keyboard shortcuts

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