topo

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 5 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Vendor_name = map[int32]string{
		0:  "UNKNOWN",
		1:  "HOST",
		2:  "ARISTA",
		3:  "CISCO",
		4:  "JUNIPER",
		5:  "KEYSIGHT",
		6:  "FRR",
		7:  "QUAGGA",
		8:  "GOBGP",
		9:  "NOKIA",
		10: "OPENCONFIG",
	}
	Vendor_value = map[string]int32{
		"UNKNOWN":    0,
		"HOST":       1,
		"ARISTA":     2,
		"CISCO":      3,
		"JUNIPER":    4,
		"KEYSIGHT":   5,
		"FRR":        6,
		"QUAGGA":     7,
		"GOBGP":      8,
		"NOKIA":      9,
		"OPENCONFIG": 10,
	}
)

Enum value maps for Vendor.

View Source
var (
	Node_Type_name = map[int32]string{
		0:  "UNKNOWN",
		1:  "HOST",
		2:  "ARISTA_CEOS",
		3:  "JUNIPER_CEVO",
		4:  "CISCO_CXR",
		5:  "QUAGGA",
		6:  "FRR",
		7:  "JUNIPER_VMX",
		8:  "CISCO_CSR",
		9:  "NOKIA_SRL",
		10: "IXIA_TG",
		11: "GOBGP",
		12: "CISCO_XRD",
		13: "CISCO_E8000",
		14: "LEMMING",
	}
	Node_Type_value = map[string]int32{
		"UNKNOWN":      0,
		"HOST":         1,
		"ARISTA_CEOS":  2,
		"JUNIPER_CEVO": 3,
		"CISCO_CXR":    4,
		"QUAGGA":       5,
		"FRR":          6,
		"JUNIPER_VMX":  7,
		"CISCO_CSR":    8,
		"NOKIA_SRL":    9,
		"IXIA_TG":      10,
		"GOBGP":        11,
		"CISCO_XRD":    12,
		"CISCO_E8000":  13,
		"LEMMING":      14,
	}
)

Enum value maps for Node_Type.

Functions

This section is empty.

Types

type CertificateCfg

type CertificateCfg struct {

	// Types that are assignable to Config:
	//
	//	*CertificateCfg_SelfSigned
	Config isCertificateCfg_Config `protobuf_oneof:"config"`
	// contains filtered or unexported fields
}

func (*CertificateCfg) Descriptor deprecated

func (*CertificateCfg) Descriptor() ([]byte, []int)

Deprecated: Use CertificateCfg.ProtoReflect.Descriptor instead.

func (*CertificateCfg) GetConfig

func (m *CertificateCfg) GetConfig() isCertificateCfg_Config

func (*CertificateCfg) GetSelfSigned

func (x *CertificateCfg) GetSelfSigned() *SelfSignedCertCfg

func (*CertificateCfg) ProtoMessage

func (*CertificateCfg) ProtoMessage()

func (*CertificateCfg) ProtoReflect

func (x *CertificateCfg) ProtoReflect() protoreflect.Message

func (*CertificateCfg) Reset

func (x *CertificateCfg) Reset()

func (*CertificateCfg) String

func (x *CertificateCfg) String() string

type CertificateCfg_SelfSigned

type CertificateCfg_SelfSigned struct {
	// self_signed will generate local certificates on the node.
	SelfSigned *SelfSignedCertCfg `protobuf:"bytes,1,opt,name=self_signed,json=selfSigned,proto3,oneof"`
}

type Config

type Config struct {
	Command []string `protobuf:"bytes,1,rep,name=command,proto3" json:"command,omitempty"` // Command to pass into pod.
	Args    []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`       // Command args to pass into the pod.
	Image   string   `protobuf:"bytes,3,opt,name=image,proto3" json:"image,omitempty"`     // Docker image to use with pod.
	// Map of environment variables to pass into the pod.
	Env map[string]string `` /* 147-byte string literal not displayed */
	// Specific entry point command for accessing the pod.
	EntryCommand string `protobuf:"bytes,5,opt,name=entry_command,json=entryCommand,proto3" json:"entry_command,omitempty"`
	// Mount point for configuration inside the pod.
	ConfigPath string `protobuf:"bytes,6,opt,name=config_path,json=configPath,proto3" json:"config_path,omitempty"`
	// Default configuration file name for the pod.
	ConfigFile string `protobuf:"bytes,7,opt,name=config_file,json=configFile,proto3" json:"config_file,omitempty"`
	Sleep      uint32 `protobuf:"varint,8,opt,name=sleep,proto3" json:"sleep,omitempty"` // Sleeptime before starting the pod.
	// Certificate configuration
	Cert *CertificateCfg `protobuf:"bytes,9,opt,name=cert,proto3" json:"cert,omitempty"`
	// Types that are assignable to ConfigData:
	//
	//	*Config_Data
	//	*Config_File
	ConfigData isConfig_ConfigData `protobuf_oneof:"config_data"`
	// Docker image to use as an init container for the pod.
	InitImage string `protobuf:"bytes,10,opt,name=init_image,json=initImage,proto3" json:"init_image,omitempty"`
	// Vendor-specific data
	VendorData *any1.Any `protobuf:"bytes,11,opt,name=vendor_data,json=vendorData,proto3" json:"vendor_data,omitempty"`
	// contains filtered or unexported fields
}

Config is the k8s pod specific configuration for a node.

func (*Config) Descriptor deprecated

func (*Config) Descriptor() ([]byte, []int)

Deprecated: Use Config.ProtoReflect.Descriptor instead.

func (*Config) GetArgs

func (x *Config) GetArgs() []string

func (*Config) GetCert

func (x *Config) GetCert() *CertificateCfg

func (*Config) GetCommand

func (x *Config) GetCommand() []string

func (*Config) GetConfigData

func (m *Config) GetConfigData() isConfig_ConfigData

func (*Config) GetConfigFile

func (x *Config) GetConfigFile() string

func (*Config) GetConfigPath

func (x *Config) GetConfigPath() string

func (*Config) GetData

func (x *Config) GetData() []byte

func (*Config) GetEntryCommand

func (x *Config) GetEntryCommand() string

func (*Config) GetEnv

func (x *Config) GetEnv() map[string]string

func (*Config) GetFile

func (x *Config) GetFile() string

func (*Config) GetImage

func (x *Config) GetImage() string

func (*Config) GetInitImage

func (x *Config) GetInitImage() string

func (*Config) GetSleep

func (x *Config) GetSleep() uint32

func (*Config) GetVendorData added in v0.1.7

func (x *Config) GetVendorData() *any1.Any

func (*Config) ProtoMessage

func (*Config) ProtoMessage()

func (*Config) ProtoReflect

func (x *Config) ProtoReflect() protoreflect.Message

func (*Config) Reset

func (x *Config) Reset()

func (*Config) String

func (x *Config) String() string

type Config_Data

type Config_Data struct {
	// Byte data for the startup configuration file.
	Data []byte `protobuf:"bytes,101,opt,name=data,proto3,oneof"`
}

type Config_File

type Config_File struct {
	// File is always relative to the topology configuration file.
	File string `protobuf:"bytes,102,opt,name=file,proto3,oneof"`
}

type Interface

type Interface struct {

	// Name of the interface provided by Node implementation. This will be used
	// to map the int_name into a vendor specific interface name. Vendor operators
	// should provide the name mapping from the node interface key to this vendor
	// specific name.
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// Internal device name. This name matches the key in the Node interface map.
	// It will be returned by the operator. Assigned by KNE.
	IntName string `protobuf:"bytes,2,opt,name=int_name,json=intName,proto3" json:"int_name,omitempty"`
	Mtu     uint32 `protobuf:"varint,3,opt,name=mtu,proto3" json:"mtu,omitempty"` // Desired MTU for the interface.
	// Peer node name. Assigned by KNE.
	PeerName string `protobuf:"bytes,4,opt,name=peer_name,json=peerName,proto3" json:"peer_name,omitempty"`
	// Peer interface name. Assigned by KNE.
	PeerIntName string `protobuf:"bytes,5,opt,name=peer_int_name,json=peerIntName,proto3" json:"peer_int_name,omitempty"`
	// Uid is the internal link identifier used by Meshnet.
	Uid int64 `protobuf:"varint,6,opt,name=uid,proto3" json:"uid,omitempty"`
	// Name of group to which this interface belongs
	Group string `protobuf:"bytes,7,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

Interface keys must be the same as the links a,z int.

func (*Interface) Descriptor deprecated

func (*Interface) Descriptor() ([]byte, []int)

Deprecated: Use Interface.ProtoReflect.Descriptor instead.

func (*Interface) GetGroup

func (x *Interface) GetGroup() string

func (*Interface) GetIntName

func (x *Interface) GetIntName() string

func (*Interface) GetMtu

func (x *Interface) GetMtu() uint32

func (*Interface) GetName

func (x *Interface) GetName() string

func (*Interface) GetPeerIntName

func (x *Interface) GetPeerIntName() string

func (*Interface) GetPeerName

func (x *Interface) GetPeerName() string

func (*Interface) GetUid

func (x *Interface) GetUid() int64

func (*Interface) ProtoMessage

func (*Interface) ProtoMessage()

func (*Interface) ProtoReflect

func (x *Interface) ProtoReflect() protoreflect.Message

func (*Interface) Reset

func (x *Interface) Reset()

func (*Interface) String

func (x *Interface) String() string
type Link struct {
	ANode string `protobuf:"bytes,1,opt,name=a_node,json=aNode,proto3" json:"a_node,omitempty"`
	AInt  string `protobuf:"bytes,2,opt,name=a_int,json=aInt,proto3" json:"a_int,omitempty"`
	ZNode string `protobuf:"bytes,3,opt,name=z_node,json=zNode,proto3" json:"z_node,omitempty"`
	ZInt  string `protobuf:"bytes,4,opt,name=z_int,json=zInt,proto3" json:"z_int,omitempty"`
	// contains filtered or unexported fields
}

Link is single link between nodes in the topology. Interfaces must start eth1 - eth0 is the default k8s interface.

func (*Link) Descriptor deprecated

func (*Link) Descriptor() ([]byte, []int)

Deprecated: Use Link.ProtoReflect.Descriptor instead.

func (*Link) GetAInt

func (x *Link) GetAInt() string

func (*Link) GetANode

func (x *Link) GetANode() string

func (*Link) GetZInt

func (x *Link) GetZInt() string

func (*Link) GetZNode

func (x *Link) GetZNode() string

func (*Link) ProtoMessage

func (*Link) ProtoMessage()

func (*Link) ProtoReflect

func (x *Link) ProtoReflect() protoreflect.Message

func (*Link) Reset

func (x *Link) Reset()

func (*Link) String

func (x *Link) String() string

type Node

type Node struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // Name of the node in the topology. Must be unique.
	// Deprecated: Do not use.
	Type   Node_Type         `protobuf:"varint,2,opt,name=type,proto3,enum=topo.Node_Type" json:"type,omitempty"`
	Labels map[string]string `` // Metadata labels describing the node.
	/* 153-byte string literal not displayed */
	Config   *Config             `protobuf:"bytes,5,opt,name=config,proto3" json:"config,omitempty"` // Pod specific configuration of the node.
	Services map[uint32]*Service ``                                                                  // Map of services to enable on the node.
	/* 158-byte string literal not displayed */
	Constraints map[string]string `` // Any k8s constraints required by node.
	/* 163-byte string literal not displayed */
	Vendor  Vendor `protobuf:"varint,8,opt,name=vendor,proto3,enum=topo.Vendor" json:"vendor,omitempty"` // Vendor enum replaces type.
	Model   string `protobuf:"bytes,9,opt,name=model,proto3" json:"model,omitempty"`                     // Model of the node.
	Version string `protobuf:"bytes,10,opt,name=version,proto3" json:"version,omitempty"`                // Version string used to identify a software release.
	Os      string `protobuf:"bytes,11,opt,name=os,proto3" json:"os,omitempty"`                          // Operating system type.
	// Interfaces is a map of container interfaces used by the node.
	// If interfaces is empty the interfaces defined in the links portion of the
	// topology will be populated into the node.
	Interfaces map[string]*Interface `` /* 162-byte string literal not displayed */
	// contains filtered or unexported fields
}

Node is a single container inside the topology

func (*Node) Descriptor deprecated

func (*Node) Descriptor() ([]byte, []int)

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetConfig

func (x *Node) GetConfig() *Config

func (*Node) GetConstraints

func (x *Node) GetConstraints() map[string]string

func (*Node) GetInterfaces

func (x *Node) GetInterfaces() map[string]*Interface

func (*Node) GetLabels

func (x *Node) GetLabels() map[string]string

func (*Node) GetModel

func (x *Node) GetModel() string

func (*Node) GetName

func (x *Node) GetName() string

func (*Node) GetOs

func (x *Node) GetOs() string

func (*Node) GetServices

func (x *Node) GetServices() map[uint32]*Service

func (*Node) GetType deprecated

func (x *Node) GetType() Node_Type

Deprecated: Do not use.

func (*Node) GetVendor

func (x *Node) GetVendor() Vendor

func (*Node) GetVersion

func (x *Node) GetVersion() string

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

func (x *Node) ProtoReflect() protoreflect.Message

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

type Node_Type

type Node_Type int32
const (
	Node_UNKNOWN      Node_Type = 0
	Node_HOST         Node_Type = 1
	Node_ARISTA_CEOS  Node_Type = 2
	Node_JUNIPER_CEVO Node_Type = 3
	Node_CISCO_CXR    Node_Type = 4
	Node_QUAGGA       Node_Type = 5
	Node_FRR          Node_Type = 6
	Node_JUNIPER_VMX  Node_Type = 7
	Node_CISCO_CSR    Node_Type = 8
	Node_NOKIA_SRL    Node_Type = 9
	Node_IXIA_TG      Node_Type = 10
	Node_GOBGP        Node_Type = 11
	Node_CISCO_XRD    Node_Type = 12
	Node_CISCO_E8000  Node_Type = 13
	Node_LEMMING      Node_Type = 14
)

func (Node_Type) Descriptor

func (Node_Type) Descriptor() protoreflect.EnumDescriptor

func (Node_Type) Enum

func (x Node_Type) Enum() *Node_Type

func (Node_Type) EnumDescriptor deprecated

func (Node_Type) EnumDescriptor() ([]byte, []int)

Deprecated: Use Node_Type.Descriptor instead.

func (Node_Type) Number

func (x Node_Type) Number() protoreflect.EnumNumber

func (Node_Type) String

func (x Node_Type) String() string

func (Node_Type) Type

type SelfSignedCertCfg

type SelfSignedCertCfg struct {

	// Certificate name on the node.
	CertName string `protobuf:"bytes,1,opt,name=cert_name,json=certName,proto3" json:"cert_name,omitempty"`
	// Key name on the node.
	KeyName string `protobuf:"bytes,2,opt,name=key_name,json=keyName,proto3" json:"key_name,omitempty"`
	// RSA keysize to use for key generation.
	KeySize uint32 `protobuf:"varint,3,opt,name=key_size,json=keySize,proto3" json:"key_size,omitempty"`
	// Common name to set in the cert.
	CommonName string `protobuf:"bytes,4,opt,name=common_name,json=commonName,proto3" json:"common_name,omitempty"`
	// contains filtered or unexported fields
}

func (*SelfSignedCertCfg) Descriptor deprecated

func (*SelfSignedCertCfg) Descriptor() ([]byte, []int)

Deprecated: Use SelfSignedCertCfg.ProtoReflect.Descriptor instead.

func (*SelfSignedCertCfg) GetCertName

func (x *SelfSignedCertCfg) GetCertName() string

func (*SelfSignedCertCfg) GetCommonName

func (x *SelfSignedCertCfg) GetCommonName() string

func (*SelfSignedCertCfg) GetKeyName

func (x *SelfSignedCertCfg) GetKeyName() string

func (*SelfSignedCertCfg) GetKeySize

func (x *SelfSignedCertCfg) GetKeySize() uint32

func (*SelfSignedCertCfg) ProtoMessage

func (*SelfSignedCertCfg) ProtoMessage()

func (*SelfSignedCertCfg) ProtoReflect

func (x *SelfSignedCertCfg) ProtoReflect() protoreflect.Message

func (*SelfSignedCertCfg) Reset

func (x *SelfSignedCertCfg) Reset()

func (*SelfSignedCertCfg) String

func (x *SelfSignedCertCfg) String() string

type Service

type Service struct {
	Name      string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`                            // Name of the service (optional)
	Inside    uint32 `protobuf:"varint,2,opt,name=inside,proto3" json:"inside,omitempty"`                       // Inside port to map Node (container listening port)
	Outside   uint32 `protobuf:"varint,3,opt,name=outside,proto3" json:"outside,omitempty"`                     // Outside port to map (target port on loadbalancer)
	InsideIp  string `protobuf:"bytes,4,opt,name=inside_ip,json=insideIp,proto3" json:"inside_ip,omitempty"`    // Assigned by KNE.
	OutsideIp string `protobuf:"bytes,5,opt,name=outside_ip,json=outsideIp,proto3" json:"outside_ip,omitempty"` // Assigned by KNE.
	NodePort  uint32 `protobuf:"varint,6,opt,name=node_port,json=nodePort,proto3" json:"node_port,omitempty"`   // Assigned by KNE.
	// contains filtered or unexported fields
}

Service is k8s Service to exposed to the cluster. The initial input can be provided by the user for which services they would like exposed. Once the service is created KNE will fill in the outside information for the user to access the services. The user should specify inside port for this is the port the container will listen on. The outside port if provided will be the load balanced advertised port. If no outsideport is provided the inside port will be used.

func (*Service) Descriptor deprecated

func (*Service) Descriptor() ([]byte, []int)

Deprecated: Use Service.ProtoReflect.Descriptor instead.

func (*Service) GetInside

func (x *Service) GetInside() uint32

func (*Service) GetInsideIp

func (x *Service) GetInsideIp() string

func (*Service) GetName

func (x *Service) GetName() string

func (*Service) GetNodePort

func (x *Service) GetNodePort() uint32

func (*Service) GetOutside

func (x *Service) GetOutside() uint32

func (*Service) GetOutsideIp

func (x *Service) GetOutsideIp() string

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) ProtoReflect

func (x *Service) ProtoReflect() protoreflect.Message

func (*Service) Reset

func (x *Service) Reset()

func (*Service) String

func (x *Service) String() string

type Topology

type Topology struct {
	Name  string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`   // Name of the topology - will be linked to the cluster name
	Nodes []*Node `protobuf:"bytes,2,rep,name=nodes,proto3" json:"nodes,omitempty"` // List of nodes in the topology
	Links []*Link `protobuf:"bytes,3,rep,name=links,proto3" json:"links,omitempty"` // connections between Nodes.
	// contains filtered or unexported fields
}

Topology message defines what nodes and links will be created inside the mesh.

func (*Topology) Descriptor deprecated

func (*Topology) Descriptor() ([]byte, []int)

Deprecated: Use Topology.ProtoReflect.Descriptor instead.

func (x *Topology) GetLinks() []*Link

func (*Topology) GetName

func (x *Topology) GetName() string

func (*Topology) GetNodes

func (x *Topology) GetNodes() []*Node

func (*Topology) ProtoMessage

func (*Topology) ProtoMessage()

func (*Topology) ProtoReflect

func (x *Topology) ProtoReflect() protoreflect.Message

func (*Topology) Reset

func (x *Topology) Reset()

func (*Topology) String

func (x *Topology) String() string

type Vendor

type Vendor int32

Vendor of the node. Topology manager uses this enum to dispatch the node to the correct controller.

const (
	Vendor_UNKNOWN    Vendor = 0
	Vendor_HOST       Vendor = 1
	Vendor_ARISTA     Vendor = 2
	Vendor_CISCO      Vendor = 3
	Vendor_JUNIPER    Vendor = 4
	Vendor_KEYSIGHT   Vendor = 5
	Vendor_FRR        Vendor = 6
	Vendor_QUAGGA     Vendor = 7
	Vendor_GOBGP      Vendor = 8
	Vendor_NOKIA      Vendor = 9
	Vendor_OPENCONFIG Vendor = 10
)

func (Vendor) Descriptor

func (Vendor) Descriptor() protoreflect.EnumDescriptor

func (Vendor) Enum

func (x Vendor) Enum() *Vendor

func (Vendor) EnumDescriptor deprecated

func (Vendor) EnumDescriptor() ([]byte, []int)

Deprecated: Use Vendor.Descriptor instead.

func (Vendor) Number

func (x Vendor) Number() protoreflect.EnumNumber

func (Vendor) String

func (x Vendor) String() string

func (Vendor) Type

func (Vendor) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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