package
1.5.0-alpha.0
Repository: https://github.com/apourchet/kubernetes.git
Documentation: pkg.go.dev

# Functions

CountAvailablePodsForReplicaSets returns the number of available pods corresponding to the given pod list and replica sets.
No description provided by the author
FindActiveOrLatest returns the only active or the latest replica set in case there is at most one active replica set.
FindNewReplicaSet returns the new RS this given deployment targets (the one with the same pod template).
FindOldReplicaSets returns the old replica sets targeted by the given Deployment, with the given PodList and slice of RSes.
GetActualReplicaCountForReplicaSets returns the sum of actual replicas of the given replica sets.
GetAllReplicaSets returns the old and new replica sets targeted by the given Deployment.
GetAvailablePodsForDeployment returns the number of available pods (listed from clientset) corresponding to the given deployment.
GetAvailablePodsForReplicaSets returns the number of available pods (listed from clientset) corresponding to the given replica sets.
GetDesiredReplicasAnnotation returns the number of desired replicas.
GetNewReplicaSet returns a replica set that matches the intent of the given deployment; get ReplicaSetList from client interface.
GetNewReplicaSetTemplate returns the desired PodTemplateSpec for the new ReplicaSet corresponding to the given ReplicaSet.
GetOldReplicaSets returns the old replica sets targeted by the given Deployment; get PodList and ReplicaSetList from client interface.
GetProportion will estimate the proportion for the provided replica set using 1.
GetReplicaCountForReplicaSets returns the sum of Replicas of the given replica sets.
IsPodAvailable return true if the pod is available.
IsRollingUpdate returns true if the strategy type is a rolling update.
IsSaturated checks if the new replica set is saturated by comparing its size with its deployment size.
LabelPodsWithHash labels all pods in the given podList with the new hash label.
LastRevision finds the second max revision number in all replica sets (the last revision).
LastSelectorUpdate returns the last time given deployment's selector is updated.
ListPods returns a list of pods the given deployment targets.
ListReplicaSets returns a slice of RSes the given deployment targets.
MaxRevision finds the highest revision in the replica sets.
MaxSurge returns the maximum surge pods a rolling deployment can take.
MaxUnavailable returns the maximum unavailable pods a rolling deployment can take.
MinAvailable returns the minimum vailable pods of a given deployment.
NewRSNewReplicas calculates the number of replicas a deployment's new RS should have.
ResolveFenceposts resolves both maxSurge and maxUnavailable.
Revision returns the revision number of the input replica set.
SelectorUpdatedBefore returns true if the former deployment's selector is updated before the latter, false otherwise.
SetDeploymentAnnotationsTo sets deployment's annotations as given RS's annotations.
SetFromReplicaSetTemplate sets the desired PodTemplateSpec from a replica set template to the given deployment.
SetNewReplicaSetAnnotations sets new replica set's annotations appropriately by updating its revision and copying required deployment annotations to it; it returns true if replica set's annotation is changed.
SetReplicasAnnotations sets the desiredReplicas and maxReplicas into the annotations.
WaitForObservedDeployment polls for deployment to be updated so that deployment.Status.ObservedGeneration >= desiredGeneration.
WaitForPodsHashPopulated polls the replica set until updated and fully labeled.
WaitForReplicaSetUpdated polls the replica set until it is updated.

# Constants

DesiredReplicasAnnotation is the desired replicas for a deployment recorded as an annotation in its replica sets.
MaxReplicasAnnotation is the maximum replicas a deployment can have at a given point, which is deployment.spec.replicas + maxSurge.
OverlapAnnotation marks deployments with overlapping selector with other deployments TODO: Delete this annotation when we gracefully handle overlapping selectors.
RevisionAnnotation is the revision annotation of a deployment's replica sets which records its rollout sequence.
RollbackDone is the done rollback event reason.
RollbackRevisionNotFound is not found rollback event reason.
RollbackTemplateUnchanged is the template unchanged rollback event reason.
SelectorUpdateAnnotation marks the last time deployment selector update TODO: Delete this annotation when we gracefully handle overlapping selectors.

# Type aliases

BySelectorLastUpdateTime sorts a list of deployments by the last update time of their selector, first using their creation timestamp and then their names as a tie breaker.