topologies

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// TODO Make it configurable
	DefaultRouteReflectorMeshName   = "rrs-to-rrs"
	DefaultRouteReflectorClientName = "peer-to-rrs-%d"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	NodeLabelKey   string
	NodeLabelValue string
	ZoneLabel      string
	ClusterID      string
	Min            int
	Max            int
	Ration         float64
}

type MultiTopology

type MultiTopology struct {
	Config
	// contains filtered or unexported fields
}

func (*MultiTopology) GenerateBGPPeers

func (t *MultiTopology) GenerateBGPPeers(routeReflectors []corev1.Node, nodes map[*corev1.Node]bool, existingPeers *calicoApi.BGPPeerList) (toRefresh []calicoApi.BGPPeer, toDelete []calicoApi.BGPPeer)

func (*MultiTopology) GetClusterID

func (t *MultiTopology) GetClusterID(nodeID string, seed int64) string

func (*MultiTopology) GetNodeLabel

func (t *MultiTopology) GetNodeLabel(nodeID string) (string, string)

func (*MultiTopology) GetRouteReflectorStatuses added in v0.1.0

func (t *MultiTopology) GetRouteReflectorStatuses(nodes map[*corev1.Node]bool) (statuses []RouteReflectorStatus)

func (*MultiTopology) IsRouteReflector

func (t *MultiTopology) IsRouteReflector(nodeID string, labels map[string]string) bool

func (*MultiTopology) NewNodeListOptions

func (t *MultiTopology) NewNodeListOptions(nodeLabels map[string]string) client.ListOptions

type RouteReflectorStatus added in v0.1.0

type RouteReflectorStatus struct {
	Zones       []string
	ActualRRs   int
	ExpectedRRs int
	Nodes       []*corev1.Node
}

type SingleTopology

type SingleTopology struct {
	Config
}

func (*SingleTopology) GenerateBGPPeers

func (t *SingleTopology) GenerateBGPPeers(_ []corev1.Node, _ map[*corev1.Node]bool, existingPeers *calicoApi.BGPPeerList) ([]calicoApi.BGPPeer, []calicoApi.BGPPeer)

func (*SingleTopology) GetClusterID

func (t *SingleTopology) GetClusterID(string, int64) string

func (*SingleTopology) GetNodeLabel

func (t *SingleTopology) GetNodeLabel(string) (string, string)

func (*SingleTopology) GetRouteReflectorStatuses added in v0.1.0

func (t *SingleTopology) GetRouteReflectorStatuses(nodes map[*corev1.Node]bool) []RouteReflectorStatus

func (*SingleTopology) IsRouteReflector

func (t *SingleTopology) IsRouteReflector(_ string, labels map[string]string) bool

func (*SingleTopology) NewNodeListOptions

func (t *SingleTopology) NewNodeListOptions(nodeLabels map[string]string) client.ListOptions

type Topology

type Topology interface {
	IsRouteReflector(string, map[string]string) bool
	GetClusterID(string, int64) string
	GetNodeLabel(string) (string, string)
	NewNodeListOptions(labels map[string]string) client.ListOptions
	GetRouteReflectorStatuses(map[*corev1.Node]bool) []RouteReflectorStatus
	GenerateBGPPeers([]corev1.Node, map[*corev1.Node]bool, *calicoApi.BGPPeerList) ([]calicoApi.BGPPeer, []calicoApi.BGPPeer)
}

func NewMultiTopology

func NewMultiTopology(config Config) Topology

func NewSingleTopology

func NewSingleTopology(config Config) Topology

Jump to

Keyboard shortcuts

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