sync

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package sync implements a queue for syncing resources to an upstream Kubernetes cluster.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	Sync(kube kubernetes.Interface, lm localmetrics.DiscovererMetrics, clusterName string) error
}

Action that is added to the queue for processing

func AddEndpointsAction

func AddEndpointsAction(endpoints *v1.Endpoints) Action

AddEndpointsAction returns an action that adds a new endpoint to the cluster

func AddServiceAction

func AddServiceAction(service *v1.Service) Action

AddServiceAction returns an action that adds a new endpoint to the cluster

func DeleteEndpointsAction

func DeleteEndpointsAction(endpoints *v1.Endpoints) Action

DeleteEndpointsAction returns an action that deletes the given endpoint from the cluster

func DeleteServiceAction

func DeleteServiceAction(service *v1.Service) Action

DeleteServiceAction returns an action that deletes the given endpoint from the cluster

func UpdateEndpointsAction

func UpdateEndpointsAction(endpoints *v1.Endpoints) Action

UpdateEndpointsAction returns an action that updates the given endpoint in the cluster

func UpdateServiceAction

func UpdateServiceAction(service *v1.Service) Action

UpdateServiceAction returns an action that updates the given endpoint in the cluster

type Queue

type Queue struct {
	Logger      *logrus.Logger
	KubeClient  kubernetes.Interface
	Workqueue   workqueue.RateLimitingInterface
	Threadiness int
	Metrics     localmetrics.DiscovererMetrics
	ClusterName string
}

Queue syncs resources with the Gimbal cluster by working through a queue of actions that must be performed against services and endpoints.

func (*Queue) Enqueue

func (sq *Queue) Enqueue(action Action)

Enqueue adds a new resource action to the worker queue

func (*Queue) Run

func (sq *Queue) Run(stopCh <-chan struct{})

Run starts the queue workers. It blocks until the stopCh is closed.

Jump to

Keyboard shortcuts

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