topologies

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: Apache-2.0 Imports: 11 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) CalculateExpectedNumber

func (t *MultiTopology) CalculateExpectedNumber(readyNodes int) int

func (*MultiTopology) GenerateBGPPeers

func (t *MultiTopology) GenerateBGPPeers(routeReflectors []corev1.Node, nodes map[*corev1.Node]bool, existingPeers *calicoApi.BGPPeerList) []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) 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 SingleTopology

type SingleTopology struct {
	Config
}

func (*SingleTopology) CalculateExpectedNumber

func (t *SingleTopology) CalculateExpectedNumber(readyNodes int) int

func (*SingleTopology) GenerateBGPPeers

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

func (*SingleTopology) GetClusterID

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

func (*SingleTopology) GetNodeLabel

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

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
	CalculateExpectedNumber(int) int
	GenerateBGPPeers([]corev1.Node, map[*corev1.Node]bool, *calicoApi.BGPPeerList) []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