Documentation
¶
Index ¶
- func CreateTopology(ctx context.Context, params TopologyParams) error
- func DeleteTopology(ctx context.Context, params TopologyParams) error
- func GenerateSelfSigned(ctx context.Context, n node.Node) error
- func GetTopologyServices(ctx context.Context, params TopologyParams) (*cpb.ShowTopologyResponse, error)
- func Load(fName string) (*tpb.Topology, error)
- type Manager
- func (m *Manager) CheckNodeStatus(ctx context.Context, timeout time.Duration) error
- func (m *Manager) ConfigPush(ctx context.Context, deviceName string, r io.Reader) error
- func (m *Manager) CreateMeshnetTopologies(ctx context.Context) error
- func (m *Manager) Delete(ctx context.Context) error
- func (m *Manager) DeleteMeshnetTopologies(ctx context.Context) error
- func (m *Manager) Load(ctx context.Context) error
- func (m *Manager) Node(nodeName string) (node.Node, error)
- func (m *Manager) Nodes() []node.Node
- func (m *Manager) Push(ctx context.Context) error
- func (m *Manager) Resources(ctx context.Context) (*Resources, error)
- func (m *Manager) TopologyProto() *tpb.Topology
- func (m *Manager) TopologyResources(ctx context.Context) ([]*topologyv1.Topology, error)
- func (m *Manager) TopologySpecs(ctx context.Context) ([]*topologyv1.Topology, error)
- func (m *Manager) Watch(ctx context.Context) error
- type Option
- type Resources
- type TopologyManager
- type TopologyParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTopology ¶
func CreateTopology(ctx context.Context, params TopologyParams) error
CreateTopology creates the topology and configs it.
func DeleteTopology ¶
func DeleteTopology(ctx context.Context, params TopologyParams) error
DeleteTopology deletes the topology.
func GenerateSelfSigned ¶
GenerateSelfSigned will try to create self signed certs on the provided node. If the node doesn't have cert info then it is a noop. If the node doesn't fulfil Certer then status.Unimplmented will be returned.
func GetTopologyServices ¶
func GetTopologyServices(ctx context.Context, params TopologyParams) (*cpb.ShowTopologyResponse, error)
GetTopologyServices returns the topology information.
Types ¶
type Manager ¶
type Manager struct {
BasePath string
// contains filtered or unexported fields
}
Manager is a topology instance manager for k8s cluster instance.
func (*Manager) CheckNodeStatus ¶
CheckNodeStatus reports node status, ignores for unimplemented nodes.
func (*Manager) ConfigPush ¶
func (*Manager) CreateMeshnetTopologies ¶
CreateMeshnetTopologies creates meshnet resources for all available nodes
func (*Manager) DeleteMeshnetTopologies ¶
DeleteMeshnetTopologies deletes meshnet resources for all available nodes
func (*Manager) TopologyProto ¶
Topology returns the topology protobuf.
func (*Manager) TopologyResources ¶
TopologyResources gets the topology CRDs for the cluster.
func (*Manager) TopologySpecs ¶
type Option ¶
type Option func(m *Manager)
func WithBasePath ¶
func WithClusterConfig ¶
func WithKubeClient ¶
func WithKubeClient(c kubernetes.Interface) Option
func WithTopoClient ¶
func WithTopoClient(c topologyclientv1.Interface) Option
func WithTopology ¶
type TopologyManager ¶
type TopologyManager interface {
CheckNodeStatus(context.Context, time.Duration) error
ConfigPush(context.Context, string, io.Reader) error
Delete(context.Context) error
Load(context.Context) error
Node(string) (node.Node, error)
Nodes() []node.Node
// TopologySpecs provides a custom implementation for constructing
// meshnet resource specs (before meshnet topology creation)
// for all configured nodes
TopologySpecs(context.Context) ([]*topologyv1.Topology, error)
// TopologySpecs provides a custom implementation for querying
// meshnet resource specs+status (after meshnet topology creation)
// for all configured nodes
TopologyResources(ctx context.Context) ([]*topologyv1.Topology, error)
Push(context.Context) error
Resources(context.Context) (*Resources, error)
TopologyProto() *tpb.Topology
Watch(context.Context) error
}
TopologyManager manages a topology.
type TopologyParams ¶
type TopologyParams struct {
TopoName string // the filename of the topology
Kubecfg string // the path of kube config
TopoNewOptions []Option // the options used in the TopoNewFunc
Timeout time.Duration
DryRun bool
}
TopologyParams specifies the parameters used by the functions that creates/deletes/show topology.