Documentation ¶
Overview ¶
nolint
Index ¶
- Constants
- Variables
- func ContainerdClient() (*containerd.Client, error)
- func CreateContainer(ctr *task.ContainerSpec) error
- func CreateContainerRecord(spec *task.ContainerSpec) error
- func CreateContainerTask(ctr *task.ContainerSpec) error
- func CreateIfx(netns string, ifx *task.EnclaveVeth, save bool) error
- func CreateInfrapodNS(name string) error
- func CreateTask(ctx context.Context, ctr containerd.Container, ns, name string) error
- func DelEnclaveBridge(spec *task.EnclaveSpec, ctx *rtnl.Context) error
- func DelEnclaveIptables(mzid string, spec *task.EnclaveSpec) error
- func DeleteContainer(name, namespace string) error
- func DeleteContainerIfx(namespace, name string) error
- func DeleteContainerImg(name, namespace string) error
- func DeleteContainerNs(namespace string) error
- func DeleteContainerRecord(name, namespace string) error
- func DeleteContainerTask(name, namespace string) error
- func DeleteIfx(netns string, ifx *task.EnclaveVeth) error
- func DeleteInfrapodNS(name string) error
- func DeleteTask(ctx context.Context, container containerd.Container) error
- func DestroyNetNS(netns *NetNS) error
- func EnclaveBridge(spec *task.EnclaveSpec, ctx *rtnl.Context) error
- func EnclaveIptables(mzid string, spec *task.EnclaveSpec) error
- func EvpnAdvertiseMac(addr, router, mac string, asn, vni, vindex int) error
- func EvpnAdvertiseMulticast(addr, router string, asn, vni, vindex int) error
- func EvpnWithdrawMac(addr, router, mac string, asn, vni, vindex int) error
- func EvpnWithdrawMulticast(addr, router string, asn, vni, vindex int) error
- func GetNativePathAttributes(p *api.Path) ([]bgp.PathAttributeInterface, error)
- func Init()
- func ListContainers(ctx context.Context) ([]containerd.Container, error)
- func ListNamespaces() ([]string, error)
- func NsDefaultRoute(mzid string, spec *task.EnclaveSpec) error
- func PullContainerImage(namespace, image string) error
- func SetupContainerLo(namespace string) error
- func WithCogCNI(netns string) oci.SpecOpts
- func WithCtrMounts(mounts []*task.ContainerMount) oci.SpecOpts
- type CogletInfo
- type Config
- type Destination
- type EvpnInfo
- type EvpnWithdrawData
- type NetConfig
- type NetNS
- type Path
- type SledConfig
- type Tuning
Constants ¶
const (
BgpSubnetMask = "/32"
)
Variables ¶
var ConfigPath string
ConfigPath is the location of the runtime configuration file
var ( //TODO just read from gobble/gobgp config? GobgpdPort = flag.Int("gobgpd-port", 50051, "gobgpd listening port") )
Functions ¶
func ContainerdClient ¶
func ContainerdClient() (*containerd.Client, error)
ContainerdClient connects to the local containerd socket interface, returning a client.
func CreateContainer ¶
func CreateContainer(ctr *task.ContainerSpec) error
CreateContainer creates a container based on the provided specification.
func CreateContainerRecord ¶
func CreateContainerRecord(spec *task.ContainerSpec) error
CreateContainerRecord stores a record of the provided container spec in the cogs datastore.
func CreateContainerTask ¶
func CreateContainerTask(ctr *task.ContainerSpec) error
CreateContainerTask loads the container from the provided specification and creates a task for it.
func CreateIfx ¶
func CreateIfx(netns string, ifx *task.EnclaveVeth, save bool) error
CreateIfx creates the specified virtual ethernet device in the provided netns.
func CreateInfrapodNS ¶
CreateInfrapodNS creates a network namespace for an infrapod.
func CreateTask ¶
CreateTask starts a task for the specified container, e.g. it runs the container.
func DelEnclaveBridge ¶
func DelEnclaveBridge(spec *task.EnclaveSpec, ctx *rtnl.Context) error
DelEnclaveBridge deletes the materialization bridge from an enclave.
func DelEnclaveIptables ¶
func DelEnclaveIptables(mzid string, spec *task.EnclaveSpec) error
DelEnclaveIptables deletes double NAT rules from an enclave
func DeleteContainer ¶
DeleteContainer deletes a container.
func DeleteContainerIfx ¶
DeleteContainerIfx loads the virtual ethernet interface identified by name within the provided namespace and deletes it.
func DeleteContainerImg ¶
DeleteContainerImg deletes an image form a container namespace.
func DeleteContainerNs ¶
DeleteContainerNs deletes a container namespace.
func DeleteContainerRecord ¶
DeleteContainerRecord locates a record for for the container identified by name in the provided namespace and removes it from the cogs data store.
func DeleteContainerTask ¶
DeleteContainerTask loads the container identified by the provided name / namespace combo and deletes its associated task.
func DeleteIfx ¶
func DeleteIfx(netns string, ifx *task.EnclaveVeth) error
DeleteIfx removes a virtual ethernet device from a network namespace.
func DeleteInfrapodNS ¶
DeleteInfrapodNS deletes the network namespace associated with the infrapod identified by name.
func DeleteTask ¶
func DeleteTask(ctx context.Context, container containerd.Container) error
DeleteTask deletes a container's task.
func EnclaveBridge ¶
func EnclaveBridge(spec *task.EnclaveSpec, ctx *rtnl.Context) error
EnclaveBridge creates the materialization enclave bridge. This bridge connects the enclave to a materializtions infrastructure network.
func EnclaveIptables ¶
func EnclaveIptables(mzid string, spec *task.EnclaveSpec) error
EnclaveIptables implements the double nat rules for an enclave so testbed nodes can access the internet through the infrastructure network.
func EvpnAdvertiseMac ¶
EvpnAdvertiseMac advertises the specified MAC on the specified VNI and updates associted vindex counters.
func EvpnAdvertiseMulticast ¶
EvpnAdvertiseMulticast sends out a type-3 multicast EVPN advertisement. The advertisement is sent to a GoBGP instance at the hostname specified by the router parameter. The addr parameter specifies the IP address to advertise, asn is the autonomous system number, vni is the VXLAN virtual network identifier and vindex in the Cogs virtual network index id.
func EvpnWithdrawMac ¶
EvpnWithdrawMac withdraws the specified MAC on the specified VNI and updates associated vindex counters.
func EvpnWithdrawMulticast ¶
EvpnWithdrawMulticast sends out a type-3 multicast EVPN withdraw
func GetNativePathAttributes ¶ added in v0.7.5
func GetNativePathAttributes(p *api.Path) ([]bgp.PathAttributeInterface, error)
func ListContainers ¶
func ListContainers(ctx context.Context) ([]containerd.Container, error)
ListContainers lists the containers in the specified context.
func ListNamespaces ¶
ListNamespaces lists current namespace names.
func NsDefaultRoute ¶
func NsDefaultRoute(mzid string, spec *task.EnclaveSpec) error
NsDefaultRoute sets up a default route in an infrapod namespace
func PullContainerImage ¶
PullContainerImage pulls the specified container image into the specified namespace.
func SetupContainerLo ¶
SetupContainerLo sets up a loopback network interface in the specified network namespace.
func WithCogCNI ¶
WithCogCNI is an OCI specification operator that binds a container to a network namespace.
func WithCtrMounts ¶
func WithCtrMounts(mounts []*task.ContainerMount) oci.SpecOpts
WithCtrMounts is an OCI specifier that can be used on container creation to plumb in the set of provided container mount points.
Types ¶
type CogletInfo ¶
type CogletInfo struct { ID string Cog string Host string Pid int // contains filtered or unexported fields }
CogletInfo contains bookkeeping information about a coglet replica.
func ListCoglets ¶
func ListCoglets() ([]*CogletInfo, error)
ListCoglets lists the coglets currently registered with the cogs datastore
func (*CogletInfo) GetVersion ¶
func (c *CogletInfo) GetVersion() int64
GetVersion gets the datastore replica version information
func (*CogletInfo) Key ¶
func (c *CogletInfo) Key() string
Key returns the datastore key for this coglet's info
func (*CogletInfo) SetVersion ¶
func (c *CogletInfo) SetVersion(v int64)
SetVersion sets the datastore replica version information
func (*CogletInfo) Value ¶
func (c *CogletInfo) Value() interface{}
Value returns this coglet as an interface object
type Config ¶
type Config struct { Etcd *common.ServiceConfig `yaml:",omitempty" json:",omitempty"` Beluga *common.ServiceConfig `yaml:",omitempty" json:",omitempty"` Tuning *Tuning `yaml:",omitempty" json:",omitempty"` Net *NetConfig `yaml:",omitempty" json:",omitempty"` Sled *SledConfig `yaml:",omitempty" json:",omitempty"` }
Config is the top level configuration object for the cogs system.
type Destination ¶
type Destination struct {
Paths []*Path
}
Destination is a set of paths.
func (*Destination) MarshalJSON ¶
func (d *Destination) MarshalJSON() ([]byte, error)
MarshalJSON creates a JSON representation of a destination.
type EvpnInfo ¶
type EvpnInfo struct { BgpIP net.IP Rd bgp.RouteDistinguisherInterface Rt bgp.ExtendedCommunityInterface }
EvpnInfo encapsulates commonly used EVPN advertisement info.
type EvpnWithdrawData ¶
type EvpnWithdrawData struct { Asn int `yaml:",omitempty"` Addr string `yaml:",omitempty"` Vindex int `yaml:",omitempty"` Vni int `yaml:",omitempty"` }
EvpnWithdrawData encapsulates information necessary to send an EVPN withdraw request
type NetConfig ¶
type NetConfig struct { VtepIfx string `yaml:"vtepIfx,omitempty" json:"vtepIfx,omitempty"` Mtu int `yaml:"mtu,omitempty" json:"mtu,omitempty"` VtepMtu int `yaml:"vtepMtu,omitempty" json:"vtepMtu,omitempty"` ServiceTunnelIP string `yaml:"serviceTunnelIP,omitempty" json:"serviceTunnelIP,omitempty"` BgpAS int `yaml:"bgpAS,omitempty" json:"bgpAS,omitempty"` ExternalIfx string `yaml:"externalIfx,omitempty" json:"externalIfx,omitempty"` ExternalIP string `yaml:"externalIP,omitempty" json:"externalIP,omitempty"` ExternalSubnet string `yaml:"externalSubnet,omitempty" json:"externalSubnet,omitempty"` ExternalGateway string `yaml:"externalGateway,omitempty" json:"externalGateway,omitempty"` }
NetConfig contains the cogs networking configuration.
type NetNS ¶
NetNS is a network namespace record that tracks containers in the netns.
func (*NetNS) GetVersion ¶
GetVersion returns the current datastore version of the object
func (*NetNS) RemoveContainer ¶
RemoveContainer removes a container from a netns object
func (*NetNS) SetVersion ¶
SetVersion sets the current datastore version of the object
type Path ¶
type Path struct { Nlri bgp.AddrPrefixInterface `json:"nlri"` Age int64 `json:"age"` Best bool `json:"best"` Attrs []bgp.PathAttributeInterface `json:"attrs"` Stale bool `json:"stale"` Withdrawal bool `json:"withdrawal,omitempty"` SourceID net.IP `json:"source-id,omitempty"` NeighborIP net.IP `json:"neighbor-ip,omitempty"` }
Path is a workaround. This for the json format compatibility. Once we update senario tests, we can remove this.
type SledConfig ¶ added in v0.7.5
type SledConfig struct { MatTimeout int `yaml:"mattimeout"` DematTimeout int `yaml:"demattimeout"` ConnTimeout int `yaml:"conntimeout"` }
SledConfig contains configurable sled items