petset

package
v1.6.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2016 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Time to sleep before polling to see if the pod cache has synced.
	PodStoreSyncedPollPeriod = 100 * time.Millisecond
)
View Source
const (

	// StatefulSetInitAnnotation is an annotation which when set, indicates that the
	// pet has finished initializing itself.
	// TODO: Replace this with init container status.
	StatefulSetInitAnnotation = "pod.alpha.kubernetes.io/initialized"
)

Variables

This section is empty.

Functions

func NewPetQueue

func NewPetQueue(ps *apps.StatefulSet, podList []*api.Pod) *petQueue

NewPetQueue returns a queue for tracking pets

func NewStatefulSetIterator

func NewStatefulSetIterator(ps *apps.StatefulSet, podList []*api.Pod) *statefulSetIterator

NewStatefulSetIterator returns a new iterator. All pods in the given podList are used to seed the queue of the iterator.

Types

type NameIdentityMapper

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

NameIdentityMapper assigns names to pets. It also puts the pet in the same namespace as the parent.

func (*NameIdentityMapper) Identity

func (n *NameIdentityMapper) Identity(pet *api.Pod) string

Identity returns the name identity of the pet.

func (*NameIdentityMapper) SetIdentity

func (n *NameIdentityMapper) SetIdentity(id string, pet *api.Pod)

SetIdentity sets the pet namespace and name.

func (*NameIdentityMapper) String

func (n *NameIdentityMapper) String(pet *api.Pod) string

String is a string function for the name identity of the pet.

type NetworkIdentityMapper

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

NetworkIdentityMapper assigns network identity to pets.

func (*NetworkIdentityMapper) Identity

func (n *NetworkIdentityMapper) Identity(pet *api.Pod) string

Identity returns the network identity of the pet.

func (*NetworkIdentityMapper) SetIdentity

func (n *NetworkIdentityMapper) SetIdentity(id string, pet *api.Pod)

SetIdentity sets network identity on the pet.

func (*NetworkIdentityMapper) String

func (n *NetworkIdentityMapper) String(pet *api.Pod) string

String is a string function for the network identity of the pet.

type PodsByCreationTimestamp

type PodsByCreationTimestamp []*api.Pod

PodsByCreationTimestamp sorts a list of Pods by creation timestamp, using their names as a tie breaker.

func (PodsByCreationTimestamp) Len

func (o PodsByCreationTimestamp) Len() int

func (PodsByCreationTimestamp) Less

func (o PodsByCreationTimestamp) Less(i, j int) bool

func (PodsByCreationTimestamp) Swap

func (o PodsByCreationTimestamp) Swap(i, j int)

type StatefulSetController

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

StatefulSetController controls statefulsets.

func NewStatefulSetController

func NewStatefulSetController(podInformer cache.SharedIndexInformer, kubeClient internalclientset.Interface, resyncPeriod time.Duration) *StatefulSetController

NewStatefulSetController creates a new statefulset controller.

func (*StatefulSetController) Run

func (psc *StatefulSetController) Run(workers int, stopCh <-chan struct{})

Run runs the statefulset controller.

func (*StatefulSetController) Sync

func (psc *StatefulSetController) Sync(key string) error

Sync syncs the given statefulset.

type VolumeIdentityMapper

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

VolumeIdentityMapper assigns storage identity to pets.

func (*VolumeIdentityMapper) GetClaims

GetClaims returns the volume claims associated with the given id. The claims belong to the statefulset. The id should be unique within a statefulset.

func (*VolumeIdentityMapper) GetClaimsForPet

func (v *VolumeIdentityMapper) GetClaimsForPet(pet *api.Pod) []api.PersistentVolumeClaim

GetClaimsForPet returns the pvcs for the given pet.

func (*VolumeIdentityMapper) Identity

func (v *VolumeIdentityMapper) Identity(pet *api.Pod) string

Identity returns the storage identity of the pet.

func (*VolumeIdentityMapper) SetIdentity

func (v *VolumeIdentityMapper) SetIdentity(id string, pet *api.Pod)

SetIdentity sets storge identity on the pet.

func (*VolumeIdentityMapper) String

func (v *VolumeIdentityMapper) String(pet *api.Pod) string

String is a string function for the network identity of the pet.

Jump to

Keyboard shortcuts

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