Documentation ¶
Index ¶
- Constants
- func NewPetQueue(ps *apps.PetSet, podList []*api.Pod) *petQueue
- func NewPetSetIterator(ps *apps.PetSet, podList []*api.Pod) *petSetIterator
- type NameIdentityMapper
- type NetworkIdentityMapper
- type PetSetController
- type PodsByCreationTimestamp
- type VolumeIdentityMapper
- func (v *VolumeIdentityMapper) GetClaims(id string) map[string]api.PersistentVolumeClaim
- func (v *VolumeIdentityMapper) GetClaimsForPet(pet *api.Pod) []api.PersistentVolumeClaim
- func (v *VolumeIdentityMapper) Identity(pet *api.Pod) string
- func (v *VolumeIdentityMapper) SetIdentity(id string, pet *api.Pod)
- func (v *VolumeIdentityMapper) String(pet *api.Pod) string
Constants ¶
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" )
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 ¶
NewPetQueue returns a queue for tracking pets
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.
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.
type PetSetController ¶
type PetSetController struct {
// contains filtered or unexported fields
}
PetSetController controls petsets.
func NewPetSetController ¶
func NewPetSetController(podInformer cache.SharedIndexInformer, kubeClient internalclientset.Interface, 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 ¶
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 ¶
func (v *VolumeIdentityMapper) GetClaims(id string) map[string]api.PersistentVolumeClaim
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.