deployment

package
v1.3.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// The revision annotation of a deployment's replica sets which records its rollout sequence
	RevisionAnnotation = "deployment.kubernetes.io/revision"

	// Here are the possible rollback event reasons
	RollbackRevisionNotFound  = "DeploymentRollbackRevisionNotFound"
	RollbackTemplateUnchanged = "DeploymentRollbackTemplateUnchanged"
	RollbackDone              = "DeploymentRollback"
)

Variables

This section is empty.

Functions

func GetActualReplicaCountForReplicaSets added in v1.2.0

func GetActualReplicaCountForReplicaSets(replicaSets []*extensions.ReplicaSet) int

GetActualReplicaCountForReplicaSets returns the sum of actual replicas of the given replica sets.

func GetAvailablePodsForReplicaSets added in v1.2.0

func GetAvailablePodsForReplicaSets(c clientset.Interface, rss []*extensions.ReplicaSet, minReadySeconds int) (int, error)

Returns the number of available pods corresponding to the given replica sets.

func GetNewReplicaSet added in v1.2.0

func GetNewReplicaSet(deployment *extensions.Deployment, c clientset.Interface) (*extensions.ReplicaSet, error)

GetNewReplicaSet returns a replica set that matches the intent of the given deployment; get ReplicaSetList from client interface. Returns nil if the new replica set doesn't exist yet.

func GetNewReplicaSetFromList

func GetNewReplicaSetFromList(deployment *extensions.Deployment, c clientset.Interface, getPodList podListFunc, getRSList rsListFunc) (*extensions.ReplicaSet, error)

GetNewReplicaSetFromList returns a replica set that matches the intent of the given deployment; get ReplicaSetList with the input function. Returns nil if the new replica set doesn't exist yet.

func GetNewReplicaSetTemplate added in v1.2.0

func GetNewReplicaSetTemplate(deployment *extensions.Deployment) api.PodTemplateSpec

Returns the desired PodTemplateSpec for the new ReplicaSet corresponding to the given ReplicaSet.

func GetOldReplicaSets added in v1.2.0

func GetOldReplicaSets(deployment *extensions.Deployment, c clientset.Interface) ([]*extensions.ReplicaSet, []*extensions.ReplicaSet, error)

GetOldReplicaSets returns the old replica sets targeted by the given Deployment; get PodList and ReplicaSetList from client interface. Note that the first set of old replica sets doesn't include the ones with no pods, and the second set of old replica sets include all old replica sets.

func GetOldReplicaSetsFromLists

func GetOldReplicaSetsFromLists(deployment *extensions.Deployment, c clientset.Interface, getPodList podListFunc, getRSList rsListFunc) ([]*extensions.ReplicaSet, []*extensions.ReplicaSet, error)

GetOldReplicaSetsFromLists returns two sets of old replica sets targeted by the given Deployment; get PodList and ReplicaSetList with input functions. Note that the first set of old replica sets doesn't include the ones with no pods, and the second set of old replica sets include all old replica sets.

func GetPodsForReplicaSets added in v1.2.0

func GetPodsForReplicaSets(c clientset.Interface, replicaSets []*extensions.ReplicaSet) ([]api.Pod, error)

func GetReplicaCountForReplicaSets added in v1.2.0

func GetReplicaCountForReplicaSets(replicaSets []*extensions.ReplicaSet) int

Returns the sum of Replicas of the given replica sets.

func IsPodAvailable added in v1.2.0

func IsPodAvailable(pod *api.Pod, minReadySeconds int) bool

func IsRollingUpdate added in v1.2.0

func IsRollingUpdate(deployment *extensions.Deployment) bool

func NewRSNewReplicas added in v1.2.0

func NewRSNewReplicas(deployment *extensions.Deployment, allRSs []*extensions.ReplicaSet, newRS *extensions.ReplicaSet) (int, error)

NewRSNewReplicas calculates the number of replicas a deployment's new RS should have. When one of the followings is true, we're rolling out the deployment; otherwise, we're scaling it. 1) The new RS is saturated: newRS's replicas == deployment's replicas 2) Max number of pods allowed is reached: deployment's replicas + maxSurge == all RSs' replicas

func Revision added in v1.2.0

func Revision(rs *extensions.ReplicaSet) (int64, error)

Revision returns the revision number of the input replica set

func SetFromReplicaSetTemplate added in v1.2.0

func SetFromReplicaSetTemplate(deployment *extensions.Deployment, template api.PodTemplateSpec) *extensions.Deployment

SetFromReplicaSetTemplate sets the desired PodTemplateSpec from a replica set template to the given deployment.

func WaitForObservedDeployment added in v1.2.0

func WaitForObservedDeployment(getDeploymentFunc func() (*extensions.Deployment, error), desiredGeneration int64, interval, timeout time.Duration) error

Polls for deployment to be updated so that deployment.Status.ObservedGeneration >= desiredGeneration. Returns error if polling timesout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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