kubernetesk8s.io/kubernetes/contrib/mesos/pkg/node Index | Files

package node

import "k8s.io/kubernetes/contrib/mesos/pkg/node"

Package node provides utilities to create and update nodes

Index

Functions

func Create

func Create(client *client.Client, hostName string, labels map[string]string) (*api.Node, error)

Create creates a new node api object with the given hostname and labels

func CreateOrUpdate

func CreateOrUpdate(client *client.Client, hostName string, labels map[string]string) (*api.Node, error)

CreateOrUpdate tries to create a node api object or updates an already existing one

func IsSlaveAttributeLabel

func IsSlaveAttributeLabel(l string) bool

IsSlaveAttributeLabel returns true iff the given label is derived from a slave attribute

func IsUpToDate

func IsUpToDate(n *api.Node, labels map[string]string) bool

IsUpToDate returns true iff the node's slave labels match the given attributes labels

func NewRegistrator

func NewRegistrator(client *client.Client, lookupNode LookupFunc) *clientRegistrator

func SlaveAttributesToLabels

func SlaveAttributesToLabels(attrs []*mesos.Attribute) map[string]string

SlaveAttributesToLabels converts slave attributes into string key/value labels

func Update

func Update(client *client.Client, n *api.Node, labels map[string]string) (*api.Node, error)

Update updates an existing node api object with new labels

Types

type LookupFunc

type LookupFunc func(hostName string) *api.Node

type Registrator

type Registrator interface {
	// Register checks whether the node is registered with the given labels. If it
	// is not, it is created or updated on the apiserver. If an the node was up-to-date,
	// false is returned.
	Register(hostName string, labels map[string]string) (bool, error)

	// Start the registration loop and return immediately.
	Run(terminate <-chan struct{}) error
}

type StatusUpdater

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

func NewStatusUpdater

func NewStatusUpdater(client *client.Client, relistPeriod time.Duration, nowFunc func() time.Time) *StatusUpdater

func (*StatusUpdater) Run

func (u *StatusUpdater) Run(terminate <-chan struct{}) error

Source Files

doc.go node.go registrator.go statusupdater.go

Version
v1.2.0-alpha.4
Published
Nov 25, 2015
Platform
js/wasm
Imports
19 packages
Last checked
26 minutes ago

Tools for package owners.