Documentation ¶
Index ¶
- Constants
- func NewPetQueue(ps *apps.StatefulSet, podList []*v1.Pod) *petQueue
- func NewStatefulSetIterator(ps *apps.StatefulSet, podList []*v1.Pod) *statefulSetIterator
- type NameIdentityMapper
- type NetworkIdentityMapper
- type PodsByCreationTimestamp
- type StatefulSetController
- type VolumeIdentityMapper
- func (v *VolumeIdentityMapper) GetClaims(id string) map[string]v1.PersistentVolumeClaim
- func (v *VolumeIdentityMapper) GetClaimsForPet(pet *v1.Pod) []v1.PersistentVolumeClaim
- func (v *VolumeIdentityMapper) Identity(pet *v1.Pod) string
- func (v *VolumeIdentityMapper) SetIdentity(id string, pet *v1.Pod)
- func (v *VolumeIdentityMapper) String(pet *v1.Pod) string
Constants ¶
const ( // Time to sleep before polling to see if the pod cache has synced. PodStoreSyncedPollPeriod = 100 * time.Millisecond )
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 []*v1.Pod) *petQueue
NewPetQueue returns a queue for tracking pets
func NewStatefulSetIterator ¶
func NewStatefulSetIterator(ps *apps.StatefulSet, podList []*v1.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 *v1.Pod) string
Identity returns the name identity of the pet.
func (*NameIdentityMapper) SetIdentity ¶
func (n *NameIdentityMapper) SetIdentity(id string, pet *v1.Pod)
SetIdentity sets the pet namespace and name.
type NetworkIdentityMapper ¶
type NetworkIdentityMapper struct {
// contains filtered or unexported fields
}
NetworkIdentityMapper assigns network identity to pets.
func (*NetworkIdentityMapper) Identity ¶
func (n *NetworkIdentityMapper) Identity(pet *v1.Pod) string
Identity returns the network identity of the pet.
func (*NetworkIdentityMapper) SetIdentity ¶
func (n *NetworkIdentityMapper) SetIdentity(id string, pet *v1.Pod)
SetIdentity sets network identity on the pet.
type PodsByCreationTimestamp ¶
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 clientset.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 ¶
func (v *VolumeIdentityMapper) GetClaims(id string) map[string]v1.PersistentVolumeClaim
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 *v1.Pod) []v1.PersistentVolumeClaim
GetClaimsForPet returns the pvcs for the given pet.
func (*VolumeIdentityMapper) Identity ¶
func (v *VolumeIdentityMapper) Identity(pet *v1.Pod) string
Identity returns the storage identity of the pet.
func (*VolumeIdentityMapper) SetIdentity ¶
func (v *VolumeIdentityMapper) SetIdentity(id string, pet *v1.Pod)
SetIdentity sets storage identity on the pet.