orchestration

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2018 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IPAM string

IPAM system being used

Functions

func MetaNameIndexFunc

func MetaNameIndexFunc(obj interface{}) ([]string, error)

MetaNameIndexFunc indexes based on an object's name

Types

type Client

type Client interface {
	// Runs the client, watching for resources
	Run(stopCh <-chan struct{})

	// Annotates resources that contain given hosts with the given IP address
	AnnotateResources(ip string, hosts []string)
	// contains filtered or unexported methods
}

Client defines the interface the orchestration should implement

type GroupKey

type GroupKey struct {
	Name    string
	Netview string
	Cidr    string
}

GroupKey indexes into a group of Specs

type IPGroup

type IPGroup struct {
	Groups     IPGroups
	GroupMutex *sync.Mutex
}

IPGroup is a struct of IPGroups and a protective mutex

func (*IPGroup) GetAllHosts

func (ipGrp *IPGroup) GetAllHosts() []string

GetAllHosts returns all hosts across IPGroups

func (*IPGroup) NumHosts

func (ipGrp *IPGroup) NumHosts() int

NumHosts returns the number of total hosts stored

type IPGroups

type IPGroups map[GroupKey][]Spec

IPGroups are groups of Specs Specs in the same group will share an IP address Specs in the "" (empty string) group will get their own IP addresses

type K8sClient

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

K8sClient that the controller uses to talk to Kubernetes

func NewKubernetesClient

func NewKubernetesClient(
	params *KubeParams,
) (*K8sClient, error)

NewKubernetesClient sets up an interface with Kubernetes

func (*K8sClient) AnnotateResources

func (client *K8sClient) AnnotateResources(ip string, hosts []string)

AnnotateResources that contain given hosts with the given IP address

func (*K8sClient) Run

func (client *K8sClient) Run(stopCh <-chan struct{})

Run starts the kubernetes client, watching for resource updates

type KubeParams

type KubeParams struct {
	KubeClient kubernetes.Interface

	Namespaces     []string
	NamespaceLabel string
	Channel        chan<- bytes.Buffer
	// contains filtered or unexported fields
}

KubeParams allows NewKubernetesClient to receive all or some parameters

type Spec

type Spec struct {
	Kind      string
	Name      string
	Namespace string
	Hosts     []string
	Netview   string // used for non-shared IP group
	Cidr      string // used for non-shared IP group
}

Spec represents a single resource and its hosts

Jump to

Keyboard shortcuts

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