petset

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2016 License: Apache-2.0, Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// PetSetInitAnnotation is an annotation which when set, indicates that the
	// pet has finished initializing itself.
	// TODO: Replace this with init container status.
	PetSetInitAnnotation = "pod.alpha.kubernetes.io/initialized"
)
View Source
const (
	// Time to sleep before polling to see if the pod cache has synced.
	PodStoreSyncedPollPeriod = 100 * time.Millisecond
)

Variables

This section is empty.

Functions

func NewPetQueue

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

NewPetQueue returns a queue for tracking pets

func NewPetSetIterator

func NewPetSetIterator(ps *apps.PetSet, podList []*api.Pod) *petSetIterator

NewPetSetIterator 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 PetSetController

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

PetSetController controls petsets.

func NewPetSetController

func NewPetSetController(podInformer framework.SharedIndexInformer, kubeClient *client.Client, resyncPeriod time.Duration) *PetSetController

NewPetSetController creates a new petset controller.

func (*PetSetController) Run

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

Run runs the petset controller.

func (*PetSetController) Sync

func (psc *PetSetController) Sync(key string) []error

Sync syncs the given petset.

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 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 petset. The id should be unique within a petset.

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