topo

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 41 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(path string) (*tpb.Topology, error)

Load loads a Topology from path.

Types

type Manager

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

Manager is a topology manager for a cluster instance.

func New

func New(topo *tpb.Topology, opts ...Option) (*Manager, error)

New creates a new Manager based on the provided topology. The cluster config passed from the WithClusterConfig option overrides the determined in-cluster config. If neither of these configurations can be used then the kubecfg passed from the WithKubecfg option will be used to determine the cluster config.

func (*Manager) ConfigPush

func (m *Manager) ConfigPush(ctx context.Context, nodeName string, r io.Reader) error

ConfigPush will push config to the provided node. If the node does not fulfill ConfigPusher then status.Unimplemented error will be returned.

func (*Manager) Create added in v0.1.3

func (m *Manager) Create(ctx context.Context, timeout time.Duration) (rerr error)

Create creates the topology in the cluster.

func (*Manager) Delete

func (m *Manager) Delete(ctx context.Context) error

Delete deletes the topology from the cluster.

func (*Manager) GenerateSelfSigned added in v0.1.3

func (m *Manager) GenerateSelfSigned(ctx context.Context, nodeName string) error

GenerateSelfSigned will create self signed certs on the provided node. If the node does not have cert info then it is a noop. If the node does not fulfill Certer then status.Unimplemented error will be returned.

func (*Manager) Nodes

func (m *Manager) Nodes() map[string]node.Node

Nodes returns a map of node names to implementations in the current topology.

func (*Manager) ResetCfg added in v0.1.3

func (m *Manager) ResetCfg(ctx context.Context, nodeName string) error

ResetCfg will reset the config for the provided node. If the node does not fulfill Resetter then status.Unimplemented error will be returned.

func (*Manager) Resources

func (m *Manager) Resources(ctx context.Context) (*Resources, error)

Resources gets the currently configured resources from the topology.

func (*Manager) Show added in v0.1.3

Show returns the topology information including services and node health.

func (*Manager) Watch

func (m *Manager) Watch(ctx context.Context) error

type Option

type Option func(m *Manager)

func WithBasePath

func WithBasePath(s string) Option

func WithClusterConfig

func WithClusterConfig(r *rest.Config) Option

func WithKubeClient

func WithKubeClient(c kubernetes.Interface) Option

func WithKubecfg added in v0.1.3

func WithKubecfg(k string) Option

func WithProgress added in v0.1.14

func WithProgress(b bool) Option

WithProgress returns a Manager Option where true causes pod progress to be displayed.

func WithSkipDeleteWait added in v0.1.15

func WithSkipDeleteWait(b bool) Option

WithSkipDeleteWait will not wait for resources to be cleaned up before Delete returns.

func WithTopoClient

func WithTopoClient(c topologyclientv1.Interface) Option

func WithUsageReporting added in v0.1.14

func WithUsageReporting(b bool, project, topic string) Option

WithUsageReporting writes anonymous usage metrics.

type Resources

type Resources struct {
	Services   map[string][]*corev1.Service
	Pods       map[string][]*corev1.Pod
	ConfigMaps map[string]*corev1.ConfigMap
	Topologies map[string]*topologyv1.Topology
}

Directories

Path Synopsis
drivenets
Package drivenets implmements node definitions for nodes from the Drivenets vendor.
Package drivenets implmements node definitions for nodes from the Drivenets vendor.
openconfig
Package openconfig implmements node definitions for nodes from the OpenConfig vendor.
Package openconfig implmements node definitions for nodes from the OpenConfig vendor.

Jump to

Keyboard shortcuts

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