Documentation
¶
Overview ¶
Package cluster provides functions to access, check, and inspect Chubo clusters.
Index ¶
- func Crashdump(ctx context.Context, cluster provision.Cluster, logWriter io.Writer, ...)
- func MapProvisionNodeInfosToNodeInfosByType(nodes []provision.NodeInfo) (map[machine.Type][]NodeInfo, error)
- func NodesMatch(expected, actual []NodeInfo) error
- func SaveClusterLogsArchive(statePath, archivePath string)
- type APIBootstrapper
- type ApplyConfigClient
- type Bootstrapper
- type ClientProvider
- type ConfigClientProvider
- type CrashDumper
- type Info
- type LocalClientProvider
- type NodeInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Crashdump ¶
func Crashdump(ctx context.Context, cluster provision.Cluster, logWriter io.Writer, zipFilePath string)
Crashdump is a no-op in chubo builds.
Chubo support collection is handled by dedicated chuboctl support flows.
func MapProvisionNodeInfosToNodeInfosByType ¶
func MapProvisionNodeInfosToNodeInfosByType(nodes []provision.NodeInfo) (map[machine.Type][]NodeInfo, error)
MapProvisionNodeInfosToNodeInfosByType maps provision.NodeInfos to cluster.NodeInfos, grouping them by machine type.
func NodesMatch ¶
NodesMatch asserts that the provided expected set of nodes match the actual set of nodes.
Each expectedNode IPs should have a non-empty intersection with actualNode IPs.
func SaveClusterLogsArchive ¶
func SaveClusterLogsArchive(statePath, archivePath string)
SaveClusterLogsArchive saves all logs from the cluster state directory to a gzip archive.
Types ¶
type APIBootstrapper ¶
type APIBootstrapper struct {
ClientProvider
Info
}
APIBootstrapper bootstraps cluster via Chubo API.
func (*APIBootstrapper) ApplyConfig ¶
func (s *APIBootstrapper) ApplyConfig(ctx context.Context, nodes []provision.NodeRequest, sl provision.SiderolinkRequest, out io.Writer) error
ApplyConfig on the node via the API using insecure mode.
type ApplyConfigClient ¶
type ApplyConfigClient struct {
ClientProvider
Info
}
ApplyConfigClient client to apply config.
type Bootstrapper ¶
Bootstrapper performs cluster bootstrap.
type ClientProvider ¶
type ClientProvider interface {
// Client returns an OS client instance for default (if no endpoints are given) or
// specific endpoint.
Client(endpoints ...string) (*client.Client, error)
// Close client connections.
Close() error
}
ClientProvider builds an OS client by endpoint.
Client instance should be cached and closed when Close() is called.
type ConfigClientProvider ¶
type ConfigClientProvider struct {
// DefaultClient to be used when using default endpoints.
//
// Not required, if missing client will be constructed from the config.
DefaultClient *client.Client
// ChuboConfig is the primary client configuration.
ChuboConfig *clientconfig.Config
// TalosConfig is a legacy compatibility alias.
TalosConfig *clientconfig.Config
// contains filtered or unexported fields
}
ConfigClientProvider builds an OS client from client config.
func (*ConfigClientProvider) Client ¶
func (c *ConfigClientProvider) Client(endpoints ...string) (*client.Client, error)
Client returns OS client instance for default (if no endpoints are given) or specific endpoints.
Client implements ClientProvider interface.
func (*ConfigClientProvider) Close ¶
func (c *ConfigClientProvider) Close() error
Close all the client connections.
type CrashDumper ¶
CrashDumper captures cluster state to the specified writer for debugging.
type Info ¶
type Info interface {
// Nodes returns list of all node infos.
Nodes() []NodeInfo
// NodesByType return list of node endpoints by type.
NodesByType(machine.Type) []NodeInfo
}
Info describes the cluster.
type LocalClientProvider ¶
type LocalClientProvider struct {
// contains filtered or unexported fields
}
LocalClientProvider builds an OS client to connect to same-node apid instance over file socket.
func (*LocalClientProvider) Client ¶
func (c *LocalClientProvider) Client(endpoints ...string) (*client.Client, error)
Client returns an OS client instance for default (if no endpoints are given) or specific endpoints.
Client implements ClientProvider interface.
func (*LocalClientProvider) Close ¶
func (c *LocalClientProvider) Close() error
Close all the client connections.
type NodeInfo ¶
NodeInfo describes a cluster node.
func IPToNodeInfo ¶
IPToNodeInfo converts a node internal IP to a NodeInfo.
func IPsToNodeInfos ¶
IPsToNodeInfos converts list of IPs to a list of NodeInfos.