parser

package
v0.0.0-...-2239885 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllocateAppIndex

func AllocateAppIndex(app, lpName *string, index *int, ipv4Net, ipv6Net *net.IPNet, ipam map[string]*IpamApp) (*string, *string, error)

func AllocateIP

func AllocateIP(ipAddresses *map[string]map[int]map[string][]*AllocatedIPInfo, cnfName *string, group *int, allocShortName, allocLongName *string, ipIndex *int, ipv4Net, ipv6Net *net.IPNet, deployIPAM map[string]*IpamApp) (*string, *string)

func BoolPtr

func BoolPtr(b bool) *bool

func GetIndexedIP

func GetIndexedIP(subnet *net.IPNet, index int) (net.IP, error)

GetIndexedIP returns a net.IP that is subnet.IP + index in the contiguous IP space.

func GetLastIP

func GetLastIP(subnet *net.IPNet) (net.IP, error)

GetLastIP returns subnet's last IP

func IntPtr

func IntPtr(i int) *int

func ParseTemplates

func ParseTemplates(path string) *template.Template

func RangeSize

func RangeSize(subnet *net.IPNet) int64

RangeSize returns the size of a range in valid addresses.

func StringPtr

func StringPtr(s string) *string

func StringSlicePtr

func StringSlicePtr(s []string) *[]string

func Uint32Ptr

func Uint32Ptr(i uint32) *uint32

Types

type AllocatedIPInfo

type AllocatedIPInfo struct {
	IPAddress   *string // allocated IP address
	Application *string // allocated application
	Usage       *string // allocated usage
}

func AllocateIPIndex

func AllocateIPIndex(app, usage *string, index *int, ipNet *net.IPNet, ipam map[string]*IpamApp) (*AllocatedIPInfo, error)

type AntiAffinity

type AntiAffinity struct{}

type AppConfig

type AppConfig struct {
	ConnectivityMode *string
	Amms             bool
	Dbs              bool
	Emms             bool
	Ipds             bool
	Ipps             bool
	Necc             bool
	Paps             bool
	Aws              bool
	NetworkName      string
	NetworkShortName string
	Mcc              *int
	Mnc              *int
	Supi             [][]*string
	Dnn              []*string
	Slices           map[string]*SliceInfo // key string = slice type; element is slice differentiator
	TrackingArea     []*string
	K8sApiServer     string
	K8sDns           string
	StorageClass     string
	ContainerRepo    *ContainerRepo
	Containers       map[string]*ContainerInfo
	// key1 is wlGenericName, key2 is group, key3 is swithIndex key4 is loopback or interfce, key6 is kind/type
	// group: 0 is used for control plane; group 1, etc for LMG user plane
	Networks          map[string]map[int]map[int]map[string]map[string][]*RenderedNetworkInfo
	SwitchesPerServer *int
	UePoolCidr        *string
	Apn               *string
	// key1: sriov or ipvlan,
	// key2: ServerLogicalInterfacename (bondx),
	// key3: numa,
	// key4: switch-name,
	// value list of pfNames
	UniqueClientServer2NetworkLinks map[string]map[string]map[int]map[string][]*string
	//Switches           []string
	//ClientLinks        map[string]map[string]*ClientLinkInfo
	//UniqueClientLinks  map[string][]*ClientLinkInfo
	WorkloadShortNames map[string]*string
	ConnType           *string
	Llbs               *int
	Lmgs               *int
	K                  *int
}

func (*AppConfig) AssignNetworkInfoItfce

func (a *AppConfig) AssignNetworkInfoItfce(group *int, itfceType, wlName, multusGenericWlName *string, netwInfo *NetworkInfo, ipv4PrefixLength, ipv6PrefixLength *int, ipAddresses *map[string]map[int]map[string][]*AllocatedIPInfo, switchInfo *switchInfo, cnfInfo *CnfInfo, cnfName *string, networkIndex, switchIndex *int, clientLinkInfo *ClientLinkInfo, fipv4, fipv6, connType, netwType *string, multusInfo map[string]*MultusInfo)

func (*AppConfig) AssignNetworkInfoLoopback

func (a *AppConfig) AssignNetworkInfoLoopback(group *int, itfceType, wlName, multusGenericWlName *string, netwInfo *NetworkInfo, ipv4PrefixLength, ipv6PrefixLength *int, ipAddresses *map[string]map[int]map[string][]*AllocatedIPInfo, switchInfo *switchInfo, cnfInfo *CnfInfo, cnfName, ipv4BGPAddress, ipv6BGPAddress *string, multusInfo map[string]*MultusInfo)

func (*AppConfig) InitializeCnfContainerData

func (a *AppConfig) InitializeCnfContainerData(c *ContainerRegistry, pods map[string]map[string]interface{})

initializes the POD/Container information per CNF

func (*AppConfig) InitializeCnfNetworkData

func (a *AppConfig) InitializeCnfNetworkData(cnfName string, cnfInfo *CnfInfo, p *Parser, appIPMap *AppIPMap, clientServer2NetworkLinks map[string]map[string]map[int]map[string][]*string, switchInfo *switchInfo)

initialize the network data per cnf

func (*AppConfig) UpdateWorkloadShortNames

func (a *AppConfig) UpdateWorkloadShortNames(multusGenericWlName *string)

type AppIPMap

type AppIPMap struct {
	IPinfo map[string]*IPinfo
}

AppIPMap per workload list of IP information that is relevant for the deployment and application

func (AppIPMap) AllocateAppLoopback

func (appIPMap AppIPMap) AllocateAppLoopback(app, lpName, wlName *string, index *int, ipv4Net, ipv6Net *net.IPNet, ipam map[string]*IpamApp) (err error)

type AttachDef

type AttachDef struct {
	Name         *string
	CniVersion   *string
	ResourceName *string
	Vlan         *int
	Type         *string
	PciBusID     *string
	DeviceID     *string
	Device       *string
}

AttachDef

type BGPPeerInfo

type BGPPeerInfo struct {
	IP *string
	AS *uint32
}

type ClientGroup

type ClientGroup struct {
	TargetGroup *string
	Interfaces  map[string][]*InterfaceDetails // string index contains the leaf switch name
}

type ClientLinkInfo

type ClientLinkInfo struct {
	InterfaceName *string
	Numa          *int
}

type Cluster

type Cluster struct {
	ProjectId     *string                 `yaml:"project_id,omitempty"`
	ClusterName   *string                 `yaml:"cluster_name,omitempty"`
	Networks      map[string]*NetworkInfo `yaml:"networks,omitempty"`
	Kind          *string                 `yaml:"kind,omitempty"`
	Region        *string                 `yaml:"region,omitempty"`
	AnthosDir     *string                 `yaml:"anthos_dir,omitempty"`
	AnthosVersion *string                 `yaml:"anthos_version,omitempty"`
}

Cluster

type CnfInfo

type CnfInfo struct {
	Enabled      *bool                             `yaml:"enabled,omitempty"`
	Deployment   *string                           `yaml:"deployment,omitempty"`
	K            *int                              `yaml:"k,omitempty"`
	NameSpace    *string                           `yaml:"namespace,omitempty"`
	StorageClass *string                           `yaml:"storage_class,omitempty"`
	PrometheusIP *string                           `yaml:"prometheus_ip,omitempty"`
	Networking   *PacoNetworkInfo                  `yaml:"networking,omitempty"`
	Pods         map[string]map[string]interface{} `yaml:"pods,omitempty"`
}

CnfInfo

type Config

type Config struct {
	Name              *string                               `yaml:"name,omitempty"`
	Credentials       *Credentials                          `yaml:"credentials,omitempty"`
	Topology          *Topology                             `yaml:"topology,omitempty"`
	Cluster           *Cluster                              `yaml:"cluster,omitempty"`
	ContainerRegistry *ContainerRegistry                    `yaml:"container_registry,omitempty"`
	Infrastructure    *Infrastructure                       `yaml:"infrastructure,omitempty"`
	Workloads         map[string]map[string]*WorkloadInfo   `yaml:"workloads,omitempty"`
	Application       map[string]*PacoInfo                  `yaml:"application,omitempty"`
	AppNetworkIndexes map[string]map[string]map[string]*int `yaml:"appnetwindexes,omitempty"`
}

Config defines lab configuration as it is provided in the YAML file

type ConfigFile

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

ConfigFile type is a struct which defines parameters of the config file

type ContainerInfo

type ContainerInfo struct {
	ImageName           *string
	ImageTag            *string
	CPU                 *int
	Memory              *string
	Hugepages1Gi        *string
	NodeSelector        *string
	Antiaffinity        []string
	InitialDelaySeconds *int
	PeriodSeconds       *int
	Enabled             *bool
}

type ContainerRegistry

type ContainerRegistry struct {
	Kind     *string `yaml:"kind,omitempty"`
	Name     *string `yaml:"name,omitempty"`
	Url      *string `yaml:"url,omitempty"`
	Server   *string `yaml:"server,omitempty"`
	ImageDir *string `yaml:"image_dir,omitempty"`
	Email    *string `yaml:"email,omitempty"`
	Username *string `yaml:"username,omitempty"`
	Secret   *string `yaml:"secret,omitempty"`
}

ContainerRegistry

type ContainerRepo

type ContainerRepo struct {
	ImageRepo   *string
	ImageSecret *string
}

type Credentials

type Credentials struct {
	AnsibleUser              *string `yaml:"ansible_user,omitempty"`
	AnsibleSshPrivateKeyFile *string `yaml:"ansible_ssh_private_key_file,omitempty"`
	AnsibleSshExtraArgs      *string `yaml:"ansible_ssh_extra_args,omitempty"`
}

Credentials

type Enable

type Enable struct {
	Enable *int
}

type Endpoint

type Endpoint struct {
	Node                *Node
	PeerNode            *Node
	ShortName           *string // e1-1
	RealName            *string // ethernet-1/1
	Kind                *string // loopback, isl, access
	IPv4Prefix          *string
	IPv4NeighborPrefix  *string
	IPv4Address         *string
	IPv4NeighborAddress *string
	IPv4PrefixLength    *int
	IPv6Prefix          *string
	IPv6NeighborPrefix  *string
	IPv6Address         *string
	IPv6NeighborAddress *string
	IPv6PrefixLength    *int
	PeerAS              *uint32
	VlanTagging         *bool   // VLANid, used only for isl links
	VlanID              *string // VLANid, used only for isl links
	Lag                 *bool   // inidcation if the link is part of a LAG
	LagMemberLink       *bool   // indication if a link is a member link of a LAG; e.g. ethernet-1/1 is a memer of lag1
	LagName             *string // name of a lag, clientname is used on linux
	Sriov               *bool   // inidcation if the link is sriov enabled
	IPVlan              *bool   // inidcation if the link is ipvlan enabled
	Speed               *string // link speed
	Pxe                 *bool   // used to drive lacp-fallback
}

Endpoint is a struct that contains information of a link endpoint

type GlobalParameters

type GlobalParameters struct {
	Multus map[string]*MultusInfo `yaml:"multus,omitempty"`
}

type IPinfo

type IPinfo struct {
	N2Ipv4            *string
	N2Ipv6            *string
	N8Ipv4            *string
	N8Ipv6            *string
	N11Ipv4           *string
	N11Ipv6           *string
	N12Ipv4           *string
	N12Ipv6           *string
	N14Ipv4           *string
	N14Ipv6           *string
	N15Ipv4           *string
	N15Ipv6           *string
	N17Ipv4           *string
	N17Ipv6           *string
	N22Ipv4           *string
	N22Ipv6           *string
	N20Ipv4           *string
	N20Ipv6           *string
	N26Ipv4           *string
	N26Ipv6           *string
	NnrfIpv4          *string
	NnrfIpv6          *string
	NsmsIPv4          *string
	NsmsIPv6          *string
	AmfSvcDefaultIPv4 *string
	AmfSvcDefaultIPv6 *string
	AmfSvcLocIPv4     *string
	AmfSvcLocIPv6     *string
	AmfSvcComIPv4     *string
	AmfSvcComIPv6     *string
	AmfSvcEeIPv4      *string
	AmfSvcEeIPv6      *string
	AmfSvcMtIPv4      *string
	AmfSvcMtIPv6      *string
	NfyEirIPv4        *string
	NfyEirIPv6        *string
	NfyAmfIPv4        *string
	NfyAmfIPv6        *string
	NfyAusfIPv4       *string
	NfyAusfIPv6       *string
	NfyNrfIPv4        *string
	NfyNrfIPv6        *string
	NfyNssfIPv4       *string
	NfyNssfIPv6       *string
	NfyPcfIPv4        *string
	NfyPcfIPv6        *string
	NfySmfIPv4        *string
	NfySmfIPv6        *string
	NfyUdmIPv4        *string
	NfyUdmIPv6        *string
	DnsIpdsIPv41      *string
	DnsIpdsIPv61      *string
	DnsIpdsIPv42      *string
	DnsIpdsIPv62      *string
	InternetDNS       *string
	PrimaryDnsIP      *string
	AusfIPv4          *string
	AusfIPv6          *string
	AusfPort          *string
	UdmIPv4           *string
	UdmIPv6           *string
	UdmPort           *string
	SmfIPv4           *string
	SmfIPv6           *string
	SmfPort           *string
	UpfCpIPv4         *string
	UpfCpIPv6         *string
	UpfUpIPv4         *string
	UpfUpIPv6         *string
	UpfPort           *string
	PrometheusIP      *string
}

type Infrastructure

type Infrastructure struct {
	InternetDns      *string                 `yaml:"internet_dns,omitempty"`
	Protocols        *Protocols              `yaml:"protocols,omitempty"`
	AddressingSchema *string                 `yaml:"addressing_schema,omitempty"`
	Networks         map[string]*NetworkInfo `yaml:"networks,omitempty"`
}

Infrastructure

type InterfaceDetails

type InterfaceDetails struct {
	Endpoint *Endpoint
}

type Ipam

type Ipam struct {
	//
	IP map[string]*IpamAlloc
}

Ipam struct with index isl or lo, etc

func NewIPAM

func NewIPAM(netwInfo *NetworkInfo) (*Ipam, error)

Allocates a new IPAM struct per link Kind (network, loopback, access, etc)

func (ipam *Ipam) IPAMAllocPrefixPerLink(version, prefix *string, link *Link) (err error)

IPAMLinkPrefixAlloc function allocates the ipv4 or ipv6 prefixes per link

func (*Ipam) IPAMAllocateAddress

func (ipam *Ipam) IPAMAllocateAddress(kind *string, ipv4Cidrs, ipv6Cidrs []*string) (*Endpoint, error)

IPAMAllocateAddress - allocated address kind = network, access, loopback typically being used for loopback address allocation of the network elements

func (*Ipam) IPAMAllocateLinkPrefix

func (ipam *Ipam) IPAMAllocateLinkPrefix(link *Link, ipv4Cidr, ipv6Cidr *string) (err error)

IPAMAllocateLinkPrefix allocates a link prefix

func (*Ipam) IPEndpointAlloc

func (ipam *Ipam) IPEndpointAlloc(kind, version, prefix string, e *Endpoint) error

IPEndpointAlloc function allocates the ipv4 or ipv6 addresses; kind = network, access, loopback

type IpamAlloc

type IpamAlloc struct {
	PrefixLength     *int
	AllocatedSubnets map[string]*Link
	NextFreeSubnet   *net.IPNet
	NextFreeAddress  *string
}

IpamAlloc struct that holds the allocation of the prefix

type IpamApp

type IpamApp struct {
	Gateway      *string
	VlanID       *int
	AllocatedIPs []*AllocatedIPInfo
}

type KciKpi

type KciKpi struct {
	Name     *string
	Interval *int
}

type KcikpiInfo

type KcikpiInfo struct {
	// contains filtered or unexported fields
}
type Link struct {
	A      *Endpoint
	B      *Endpoint
	MTU    *int
	Labels map[string]*string

	Kind          *string // isl: inter switch links, access: links to clients
	VlanTagging   *bool   // VLANid, used only for isl links
	VlanID        *string // VLANid, used only for isl links
	Lag           *bool   // inidcation if the link is part of a LAG
	LagMemberLink *bool   // indication if a link is a member link of a LAG; e.g. ethernet-1/1 is a memer of lag1
	LagName       *string // name of a lag, clientname is used on linux
	ClientName    *string // used in linux as the lag name
	Numa          *int    // used to describe the numa
	Sriov         *bool   // inidcation if the link is sriov enabled
	IPVlan        *bool   // inidcation if the link is ipvlan enabled
	Speed         *string // link speed
	Pxe           *bool   // used to drive lacp-fallback
	// contains filtered or unexported fields
}

Link is a struct that contains the information of a link between 2 containers

type LinkConfig

type LinkConfig struct {
	Endpoints []*string
	Labels    map[string]*string `yaml:"labels,omitempty"`
}

type Multus

type Multus struct {
	Lmg       *MultusCnfInfo
	Llb       *MultusCnfInfo
	AttachDef []*AttachDef `yaml:"attachDef"`
	GroFlag   *int
	Dsf       *MultusDataPlaneInfo
	Xdp       *MultusDataPlaneInfo
	Dpdk      *MultusDataPlaneInfo
}

Multus

type MultusCnfInfo

type MultusCnfInfo struct {
	NumDevices   *int
	NetNames     []*string
	ResourceName *string
}

MultusCnfInfo

type MultusDataPlaneInfo

type MultusDataPlaneInfo struct {
	Enable        *int
	NumDsfDevices *int
}

MultusDataPlaneInfo

type MultusInfo

type MultusInfo struct {
	WorkloadName *string `yaml:"wl-name,omitempty"`
	VrfCpId      *int    `yaml:"vrfcp-id,omitempty"`
	VrfUpId      *int    `yaml:"vrfup-id,omitempty"`
}

type Neighbor

type Neighbor struct {
	PeerIP           string
	PeerAS           uint32
	PeerGroup        string
	LocalAS          uint32
	TransportAddress string
}

type NetworkInfo

type NetworkInfo struct {
	Ipv4Cidr              []*string `yaml:"ipv4_cidr,omitempty"`
	Ipv4ItfcePrefixLength *int      `yaml:"ipv4_itfce_prefix_length,omitempty"`
	Ipv6Cidr              []*string `yaml:"ipv6_cidr,omitempty"`
	Ipv6ItfcePrefixLength *int      `yaml:"ipv6_itfce_prefix_length,omitempty"`
	AddressingSchema      *string   `yaml:"addressing_schema,omitempty"`
	Type                  *string   `yaml:"type,omitempty"`
	VlanID                *int      `yaml:"vlan_id,omitempty"`
	Kind                  *string   `yaml:"kind,omitempty"`
	Target                *string   `yaml:"target,omitempty"`
	NetworkIndex          *int
	SwitchIndex           *int

	TemplateKind       string
	Ipv4ItfceAddresses []*AllocatedIPInfo
	Ipv6ItfceAddresses []*AllocatedIPInfo
	//Ipv4UpItfceAddresses  map[int][]*AllocatedIPInfo // key is the group
	//Ipv6UpItfceAddresses  map[int][]*AllocatedIPInfo // key is the group
	Ipv4CpAddresses       []*AllocatedIPInfo
	Ipv6CpAddresses       []*AllocatedIPInfo
	Ipv4UpAddresses       map[int][]*AllocatedIPInfo // key is the group
	Ipv6UpAddresses       map[int][]*AllocatedIPInfo // key is the group
	Ipv4FloatingIP        *string
	Ipv6FloatingIP        *string
	Ipv4Gw                *string
	Ipv6Gw                *string
	Ipv4GwPerWl           map[int][]string
	Ipv6GwPerWl           map[int][]string
	InterfaceName         *string
	InterfaceEthernetName *string
	Cni                   *string
	NetworkShortName      *string
	ResShortName          *string
	IPv4BGPPeers          map[int]*BGPPeerInfo
	IPv6BGPPeers          map[int]*BGPPeerInfo
	IPv4BGPAddress        *string
	IPv6BGPAddress        *string
	VrfCpId               *int
	VrfUpId               *int
	AS                    *uint32
}

NetworkInfo

type NetworkInstance

type NetworkInstance struct {
	Kind           *string // irb, bridged, routed
	IPv4Cidr       *string
	IPv6Cidr       *string
	VlanId         *int
	RouteTarget    *string
	Interfaces     []string
	VxlanInterface string
}

type Node

type Node struct {
	ShortName            *string
	Kind                 *string
	Type                 *string
	Labels               map[string]*string
	Group                *string
	Position             *string
	Topology             *string
	MgmtIPv4Address      *string
	MgmtIPv4PrefixLength *int
	MgmtIPv6Address      *string
	MgmtIPv6PrefixLength *int
	AS                   *uint32
	Endpoints            map[string]*Endpoint
	Target               *string
}

Node is a struct that contains the information of a node element

type NodeConfig

type NodeConfig struct {
	Kind     *string            `yaml:"kind,omitempty"`   // srl, vr-sros, linux
	Labels   map[string]*string `yaml:"labels,omitempty"` // Labels are attributes
	Group    *string            `yaml:"group,omitempty"`
	Type     *string            `yaml:"type,omitempty"` // ixrd2, sr-1s, etc
	Position *string            `yaml:"position,omitempty"`
	MgmtIPv4 *string            `yaml:"mgmt_ipv4,omitempty"` // user-defined IPv4 address in the management network
	MgmtIPv6 *string            `yaml:"mgmt_ipv6,omitempty"` // user-defined IPv6 address in the management network
	AS       *uint32            `yaml:"as,omitempty"`
}

NodeConfig represents a configuration a given node can have in the lab definition file

type NodeSelector

type NodeSelector struct{}

type PacoDeploymentInfo

type PacoDeploymentInfo struct {
	ConnectivityMode *string               `yaml:"connectivitymode,omitempty"`
	NetworkName      *string               `yaml:"networkname,omitempty"`
	NetworkShortName *string               `yaml:"networkshortname,omitempty"`
	Nat              *bool                 `yaml:"nat,omitempty"`
	SigRefPoints     *string               `yaml:"sigrefpoints,omitempty"`
	UePoolCidr       *string               `yaml:"uepoolcidr,omitempty"`
	Supi             [][]*string           `yaml:"supi,omitempty"`
	Plmn             map[string]*int       `yaml:"plmn,omitempty"`
	Dnn              []*string             `yaml:"dnn,omitempty"`
	TrackingArea     []*string             `yaml:"tac,omitempty"`
	Slices           map[string]*SliceInfo `yaml:"slices,omitempty"`
	Apn              *string               `yaml:"apn,omitempty"`
}

PacoDeployemntInfo

type PacoInfo

type PacoInfo struct {
	Global     *GlobalParameters   `yaml:"global,omitempty"`
	Deployment *PacoDeploymentInfo `yaml:"deployment,omitempty"`
	Cnfs       map[string]*CnfInfo `yaml:"cnfs,omitempty"`
}

PacoInfo

type PacoNetworkInfo

type PacoNetworkInfo struct {
	Type   *string                `yaml:"type,omitempty"`
	AS     *uint32                `yaml:"as,omitempty"`
	Multus map[string]*MultusInfo `yaml:"multus,omitempty"`
}

type Parser

type Parser struct {
	BaseSwitchDir        *string
	BaseAppValuesDir     *string
	BaseAppKustomizesDir *string
	BaseServerDir        *string
	BaseAppIpamDir       *string
	ConfigFile           *ConfigFile
	Config               *Config
	Nodes                map[string]*Node
	Links                []*Link
	IPAM                 map[string]*Ipam
	NextAS               *uint32
	Workloads            map[string]*Workload
	ClientGroups         map[string]*ClientGroup
	// DeploymentIPAM is a map where
	// first string key = multusNetworkName
	// 2nd Key string = ipvlan, sriov1, sriov2
	// 3rd key string = IP subnet, could be v4 or v6
	DeploymentIPAM map[string]map[string]map[string]*IpamApp

	// get the sriov and ipvlan networks and naming, etc
	// clientLinks["ipvlan"] -> map with sriov/ipvlan -> interface name of the server (bond0 or bond1 or multiple bonds
	// e.g. map[ipvlan:[bond0] sriov:[bond0]]
	// clientSriovInfo -> map[key=servername] with list fo switches
	// e.g. map[master0:[leaf1 leaf2]]
	//ClientLinks map[string][]*ClientLinkInfo
	// identify the server nodes and its respective leaf/tor switches
	//ClientSriovInfo map[string][]string
	// key1: sriov or ipvlan,
	// key2: ServerLogicalInterfacename (bondx),
	// key3: numa,
	// key4: switch-name,
	// value list of pfNames
	ClientServer2NetworkLinks map[string]map[string]map[int]map[string][]*string
	SwitchInfo                *switchInfo
	// contains filtered or unexported fields
}

func NewParser

func NewParser(opts ...ParserOption) *Parser

NewParser function defines a new parser

func (*Parser) AssignSwitchBgpLoopback

func (p *Parser) AssignSwitchBgpLoopback(version, ipcidr, wlName, netwType *string, bgpidx int)

func (*Parser) AssignSwitchGWs

func (p *Parser) AssignSwitchGWs(version, ipcidr, wlName, netwType *string, idx, gwidx int, netwInfo *NetworkInfo)

func (*Parser) CreateDirectory

func (p *Parser) CreateDirectory(path string, perm os.FileMode)

CreateDirectory creates a directory

func (*Parser) GetApplicationIndex

func (p *Parser) GetApplicationIndex(itfceType, element, kind *string) *int

func (*Parser) GetConfig

func (p *Parser) GetConfig(file *string) error

GetConfig parses the configuration file into p.Config structure as well as populates the ConfigFile structure with the config-file related information

func (*Parser) InitializeIPAMWorkloads

func (p *Parser) InitializeIPAMWorkloads() (err error)

func (*Parser) InitializeSwitchToServerInformation

func (p *Parser) InitializeSwitchToServerInformation()

func (*Parser) NewEndpoint

func (p *Parser) NewEndpoint(nodeShortName, epShortName *string, l *Link, peerNode *Node) *Endpoint

NewEndpoint initializes a new endpoint object

func (p *Parser) NewLink(l *LinkConfig) error

NewLink initializes a new link object

func (*Parser) NewNode

func (p *Parser) NewNode(nodeName string, nodeCfg *NodeConfig) (*Node, error)

NewNode initializes a new node object

func (*Parser) ParseApplicationData

func (p *Parser) ParseApplicationData()

func (*Parser) ParseClientGroup

func (p *Parser) ParseClientGroup() (err error)

ParseClientGroup parses the client group part of the configuration file which client groups do we have and which device, interfaces are connected

func (*Parser) ParseCnfKustomize

func (p *Parser) ParseCnfKustomize(cnfName *string, appc *AppConfig, appIPMap *AppIPMap)

func (*Parser) ParseServerData

func (p *Parser) ParseServerData()

func (*Parser) ParseTopology

func (p *Parser) ParseTopology() (err error)

ParseTopology parses the topology part of the configuration file

func (*Parser) RenderNetworkAttachement

func (p *Parser) RenderNetworkAttachement(t *template.Template, dirName *string, values *Values) error

RenderNetworkAttachement function writes the network Attachement file

func (*Parser) RenderSriovConfigMap

func (p *Parser) RenderSriovConfigMap(t *template.Template, dirName *string, sriovc map[string]map[string]map[int]map[string][]*string) error

RenderSriovConfigMap function writes the sriov config map to be used for the cluster

func (*Parser) RenderStatefulSet

func (p *Parser) RenderStatefulSet(t *template.Template, dirName *string, values *Values) error

RenderStatefulSet function writes the StatefulSet file

func (*Parser) RenderToActiveConfigMap

func (p *Parser) RenderToActiveConfigMap(t *template.Template, dirName *string, values *Values) error

RenderToActiveConfigMap function writes the ActiveConfigMap file

func (*Parser) ShowClientGroup

func (p *Parser) ShowClientGroup() error

func (*Parser) ShowTopology

func (p *Parser) ShowTopology()

ShowTopology show the topology that was initialized

func (p *Parser) UpdateUniqueClientLink(cnfInfo *CnfInfo, podName, connType *string, uniqueClientServer2NetworkLinks map[string]map[string]map[int]map[string][]*string) *ClientLinkInfo

func (*Parser) WriteApplicationDeploymentIPAM

func (p *Parser) WriteApplicationDeploymentIPAM(dirName *string)

func (*Parser) WriteBase

func (p *Parser) WriteBase()

func (*Parser) WriteClientsGroups

func (p *Parser) WriteClientsGroups() (kuztomizedirs []string)

func (*Parser) WriteCnfValues

func (p *Parser) WriteCnfValues(t *template.Template, dirName, cnfName *string, appc *AppConfig, appIPMap *AppIPMap) error

WriteUpfValues function writes the amf values file

func (*Parser) WriteFinalBase

func (p *Parser) WriteFinalBase(kdirs []string)

func (*Parser) WriteInfrastructure

func (p *Parser) WriteInfrastructure() (kuztomizedirs []string)

func (*Parser) WriteKustomize

func (p *Parser) WriteKustomize(dirName, fileName *string, resources []string) error

WriteKustomize function writes the kustomize resource file

func (*Parser) WriteSrlInterface

func (p *Parser) WriteSrlInterface(dirName, fileName, resName, target *string, interfaces []*k8ssrlinterface) error

WriteSrlInterface function writes the k8s srl interface resource

func (*Parser) WriteSrlIrbSubInterface

func (p *Parser) WriteSrlIrbSubInterface(dirName, fileName, resName, target *string, irbsubinterfaces []*k8ssrlirbsubinterface) error

WriteSrlIrbSubInterface function writes the k8s srl subinterface resource

func (*Parser) WriteSrlNetworkInstance

func (p *Parser) WriteSrlNetworkInstance(dirName, fileName, resName, target *string, netwinstance *k8ssrlNetworkInstance) error

WriteSrlNetworkInstance function writes the k8s srl network-instance resource

func (*Parser) WriteSrlNetworkInstanceBgpEvpn

func (p *Parser) WriteSrlNetworkInstanceBgpEvpn(dirName, fileName, resName, target *string, netwInstanceProtocol *k8ssrlNetworkInstance) error

WriteSrlNetworkInstanceBgpEvpn function writes the k8s srl network-instance bgpevpn protocol resource

func (*Parser) WriteSrlNetworkInstanceBgpVpn

func (p *Parser) WriteSrlNetworkInstanceBgpVpn(dirName, fileName, resName, target *string, netwInstanceProtocol *k8ssrlNetworkInstance) error

WriteSrlNetworkInstanceBgpVpn function writes the k8s srl network-instance bgpvpn protocol resource

func (*Parser) WriteSrlNetworkInstanceLinux

func (p *Parser) WriteSrlNetworkInstanceLinux(dirName, fileName, resName, target *string, netwInstanceProtocol *k8ssrlNetworkInstance) error

WriteSrlNetworkInstanceLinux function writes the k8s srl network-instance bgpevpn protocol resource

func (*Parser) WriteSrlProtocolsBgp

func (p *Parser) WriteSrlProtocolsBgp(dirName, fileName, resName, target *string, protocolsbgp *k8ssrlprotocolsbgp) error

WriteSrlNetworkInstance function writes the k8s srl protocols bgp resource

func (*Parser) WriteSrlRoutingPolicy

func (p *Parser) WriteSrlRoutingPolicy(dirName, fileName, resName, target *string, routingPolicy *k8ssrlRoutingPolicy) error

WriteSrlNetworkInstanceLinux function writes the k8s srl network-instance bgpevpn protocol resource

func (*Parser) WriteSrlSubInterface

func (p *Parser) WriteSrlSubInterface(dirName, fileName, resName, target *string, subinterfaces []*k8ssrlsubinterface) error

WriteSrlInterface function writes the k8s srl subinterface resource

func (*Parser) WriteSrlSystemNetworkInstance

func (p *Parser) WriteSrlSystemNetworkInstance(dirName, fileName, resName, target *string, esis []*k8ssrlESI) error

func (*Parser) WriteSrlTunnelInterface

func (p *Parser) WriteSrlTunnelInterface(dirName, fileName, resName, target *string, tunnelinterfaces []*k8ssrlTunnelInterface) error

WriteSrlTunnelInterface function writes the k8s srl tunnel-interface resource

func (*Parser) WriteSrlVxlanInterface

func (p *Parser) WriteSrlVxlanInterface(dirName, fileName, resName, target *string, vxlaninterfaces []*k8ssrlVxlanInterface) error

WriteSrlVxlanInterface function writes the k8s srl vxlan interface within the tunnelinterface resource

func (*Parser) WriteWorkloads

func (p *Parser) WriteWorkloads() (kuztomizedirs []string)

type ParserOption

type ParserOption func(p *Parser)

func WithConfigFile

func WithConfigFile(file *string) ParserOption

WithConfigFile initializes and marshals the config file

func WithDebug

func WithDebug(d bool) ParserOption

WithDebug initializes the debug flag

func WithOutput

func WithOutput(o *string) ParserOption

WithOutput initializes the output variable

type PeerGroup

type PeerGroup struct {
	Name       string
	PolicyName string
	Protocols  []string
}

type PodInfo

type PodInfo struct {
	Enable             *int
	ImageRepository    *string
	ImageName          *string
	ImageTag           *string
	ImagePullPolicy    *string
	ConfigReadInterval *string
	ScrapeInterval     *ScrapeInterval
}

type PodResources

type PodResources struct {
	Lmg     *Resource
	Llb     *Resource
	Loam    *Resource
	Logging *Resource
	Nasc    *Resource
}

type PodRootInfo

type PodRootInfo struct {
	Repository *string
	Name       *string
	Tag        *string
	PullPolicy *string
}

type PodSecurityPolicy

type PodSecurityPolicy struct {
	Create     *bool
	Privileged *bool
}

type Protocols

type Protocols struct {
	Protocol        *string   `yaml:"protocol,omitempty"`
	AsPool          []*uint32 `yaml:"as_pool,omitempty"`
	OverlayAs       *uint32   `yaml:"overlay_as,omitempty"`
	OverlayProtocol *string   `yaml:"overlay_protocol,omitempty"`
}

Protocols

type Redundancy

type Redundancy struct {
	Active *int
}

type RenderedNetworkInfo

type RenderedNetworkInfo struct {
	Ipv4Cidr              *string
	Ipv6Cidr              *string
	Ipv4PrefixLength      *int
	Ipv6PrefixLength      *int
	VlanID                *int
	Target                *string
	NetworkIndex          *int
	SwitchIndex           *int
	Ipv4Addresses         []*AllocatedIPInfo
	Ipv6Addresses         []*AllocatedIPInfo
	Ipv4FloatingIP        *string
	Ipv6FloatingIP        *string
	Ipv4Gw                *string
	Ipv6Gw                *string
	Ipv4GwPerWl           map[int][]string
	Ipv6GwPerWl           map[int][]string
	InterfaceName         *string
	InterfaceEthernetName *string
	Numa                  *int
	Cni                   *string
	NetworkShortName      *string
	ResShortName          *string
	IPv4BGPPeers          map[int]*BGPPeerInfo
	IPv6BGPPeers          map[int]*BGPPeerInfo
	IPv4BGPAddress        *string
	IPv6BGPAddress        *string
	VrfCpId               *int
	VrfUpId               *int
	AS                    *uint32
}

type Resource

type Resource struct {
	Cpu          *int
	Memory       *string
	Hugepages1Gi *string
	Multus       []*MultusCnfInfo
	NodeSelector *NodeSelector
}

type RtScheduling

type RtScheduling struct {
	Enable         *int
	CgroupHostPath *string
}

type Scale

type Scale struct {
	MinReplicas                    *int
	MaxReplicas                    *int
	TargetCPUUtilizationPercentage *int
}

type ScrapeInterval

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

type SliceInfo

type SliceInfo struct {
	Value int                 `yaml:"value,omitempty"`
	Diff  []map[string]string `yaml:"diff,omitempty"`
}

SliceInfo

type Storage

type Storage struct {
	PvCreation      *int
	ParentPath      *string
	PvLogsName      *string
	PvStorageClass  *string
	PvLogsClaimName *string
	PvSize          *string
	CfSize          *string
	CfAInfo         []map[string]string
	CfBInfo         []map[string]string
}

type Topology

type Topology struct {
	Defaults *NodeConfig            `yaml:"defaults,omitempty"`
	Kinds    map[string]*NodeConfig `yaml:"kinds,omitempty"`
	Nodes    map[string]*NodeConfig `yaml:"nodes,omitempty"`
	Links    []*LinkConfig          `yaml:"links,omitempty"`
}

Topology represents a lab topology

type Values

type Values struct {
	Namespace         *string
	NodeSelector      *NodeSelector
	AntiAffinity      *AntiAffinity
	Uuid              *string
	ImagePullSecret   *string
	Image             *PodRootInfo
	AwsSideCar        *PodInfo
	Logging           *PodInfo
	Nasc              *PodInfo
	Multus            *Multus
	LmgScale          *Scale
	LlbScale          *Scale
	Resources         *PodResources
	GwConfig          *string
	GwRedundancy      *Redundancy
	Storage           *Storage
	RtScheduling      *RtScheduling
	LoamB             *Enable
	PodSecurityPolicy *PodSecurityPolicy
}

type Workload

type Workload struct {
	NetworkInstance map[string]*NetworkInstance
}

type WorkloadInfo

type WorkloadInfo struct {
	Itfces    map[string]*NetworkInfo `yaml:"itfces,omitempty"`
	Loopbacks map[string]*NetworkInfo `yaml:"loopbacks,omitempty"`
}

WorkloadInfo

Jump to

Keyboard shortcuts

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