topo

package
v0.0.0-...-45f8ed2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

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

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

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

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

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

func WithKubecfg(k string) Option

func WithProgress

func WithProgress(b bool) Option

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

func WithSkipDeleteWait

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

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