Documentation
¶
Overview ¶
Package sync implements a queue for syncing resources to an upstream Kubernetes cluster.
Index ¶
- func SumEndpoints(eps *v1.Endpoints) int
- type Action
- func AddEndpointsAction(endpoints *v1.Endpoints, upstreamName string) Action
- func AddServiceAction(service *v1.Service) Action
- func DeleteEndpointsAction(endpoints *v1.Endpoints, upstreamName string) Action
- func DeleteServiceAction(service *v1.Service) Action
- func UpdateEndpointsAction(endpoints *v1.Endpoints, upstreamName string) Action
- func UpdateServiceAction(service *v1.Service) Action
- type Queue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SumEndpoints ¶ added in v0.3.0
func SumEndpoints(eps *v1.Endpoints) int
SumEndpoints takes an enpoints object and returns total number of Addresses
Types ¶
type Action ¶
type Action interface {
Sync(kube kubernetes.Interface, logger *logrus.Logger) error
ObjectMeta() *metav1.ObjectMeta
SetMetrics(gimbalKubeClient kubernetes.Interface, lm localmetrics.DiscovererMetrics, logger *logrus.Logger)
SetMetricError(metrics localmetrics.DiscovererMetrics)
GetActionType() string
}
Action that is added to the queue for processing
func AddEndpointsAction ¶
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 ¶
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 ¶
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
}
Queue syncs resources with the Gimbal cluster by working through a queue of actions that must be performed against services and endpoints.
func NewQueue ¶ added in v0.2.0
func NewQueue(logger *logrus.Logger, kubeClient kubernetes.Interface, threadiness int, metrics localmetrics.DiscovererMetrics) Queue
NewQueue returns an initialized sync.Queue for syncing resources with a Gimbal cluster.