k8s

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NodeHasHealthyEndpoint added in v0.2.0

func NodeHasHealthyEndpoint(eps *v1.Endpoints, node string) bool

NodeHasHealthyEndpoint return true if this node has at least one healthy endpoint.

Types

type Client

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

Client watches a Kubernetes cluster and translates events into Controller method calls.

func New added in v0.4.0

func New(processName, masterAddr, kubeconfig string) (*Client, error)

New connects to masterAddr, using kubeconfig to authenticate.

The client uses processName to identify itself to the cluster (e.g. when logging events).

func (*Client) Errorf

func (c *Client) Errorf(svc *v1.Service, kind, msg string, args ...interface{})

Errorf logs an error event about svc to the Kubernetes cluster.

func (*Client) HandleConfig added in v0.4.0

func (c *Client) HandleConfig(configMap string, handler func(*config.Config) error)

HandleConfig registers a handler for changes to MetalLB's configuration.

func (*Client) HandleLeadership added in v0.4.0

func (c *Client) HandleLeadership(nodeName string, handler func(bool))

HandleLeadership starts a leader election and notifies handler of changes to leadership state.

func (*Client) HandleNode added in v0.4.0

func (c *Client) HandleNode(nodeName string, handler func(*v1.Node) error)

HandleNode registers a handler for changes to the given Node.

func (*Client) HandleService added in v0.4.0

func (c *Client) HandleService(handler func(string, *v1.Service) error)

HandleService registers a handler for changes to Service objects.

func (*Client) HandleServiceAndEndpoints added in v0.4.0

func (c *Client) HandleServiceAndEndpoints(handler func(string, *v1.Service, *v1.Endpoints) error)

HandleServiceAndEndpoints registers a handler for changes to Service objects and their associated Endpoints.

func (*Client) HandleSynced added in v0.4.0

func (c *Client) HandleSynced(handler func())

HandleSynced registers a handler for the "local cache synced" signal.

func (*Client) Infof

func (c *Client) Infof(svc *v1.Service, kind, msg string, args ...interface{})

Infof logs an informational event about svc to the Kubernetes cluster.

func (*Client) Run

func (c *Client) Run(httpPort int) error

Run watches for events on the Kubernetes cluster, and dispatches calls to the Controller.

func (*Client) Update

func (c *Client) Update(svc *v1.Service) (*v1.Service, error)

Update writes svc back into the Kubernetes cluster. If successful, the updated Service is returned. Note that changes to svc.Status are not propagated, for that you need to call UpdateStatus.

func (*Client) UpdateStatus

func (c *Client) UpdateStatus(svc *v1.Service) error

UpdateStatus writes the protected "status" field of svc back into the Kubernetes cluster.

Jump to

Keyboard shortcuts

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