replicaset

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindActiveOrLatest

func FindActiveOrLatest(newRS *appsv1.ReplicaSet, oldRSs []*appsv1.ReplicaSet) *appsv1.ReplicaSet

FindActiveOrLatest returns the only active or the latest replica set in case there is at most one active replica set. If there are more active replica sets, then we should proportionally scale them.

func FindNewReplicaSet

func FindNewReplicaSet(rollout *v1alpha1.Rollout, rsList []*appsv1.ReplicaSet) *appsv1.ReplicaSet

FindNewReplicaSet returns the new RS this given rollout targets.

func FindOldReplicaSets

func FindOldReplicaSets(rollout *v1alpha1.Rollout, rsList []*appsv1.ReplicaSet) []*appsv1.ReplicaSet

FindOldReplicaSets returns the old replica sets targeted by the given Rollout, with the given slice of RSes.

func GetActualReplicaCountForReplicaSets

func GetActualReplicaCountForReplicaSets(replicaSets []*appsv1.ReplicaSet) int32

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

func GetAvailableReplicaCountForReplicaSets

func GetAvailableReplicaCountForReplicaSets(replicaSets []*appsv1.ReplicaSet) int32

GetAvailableReplicaCountForReplicaSets returns the number of available pods corresponding to the given replica sets.

func GetReadyReplicaCountForReplicaSets

func GetReadyReplicaCountForReplicaSets(replicaSets []*appsv1.ReplicaSet) int32

GetReadyReplicaCountForReplicaSets returns the number of ready pods corresponding to the given replica sets.

func GetReplicaCountForReplicaSets

func GetReplicaCountForReplicaSets(replicaSets []*appsv1.ReplicaSet) int32

GetReplicaCountForReplicaSets returns the sum of Replicas of the given replica sets.

func MaxRevision

func MaxRevision(allRSs []*appsv1.ReplicaSet) int64

MaxRevision finds the highest revision in the replica sets

func NewRSNewReplicas

func NewRSNewReplicas(rollout *v1alpha1.Rollout, allRSs []*appsv1.ReplicaSet, newRS *appsv1.ReplicaSet) (int32, error)

NewRSNewReplicas calculates the number of replicas a Rollout'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

func Revision(obj runtime.Object) (int64, error)

Revision returns the revision number of the input object.

Types

This section is empty.

Jump to

Keyboard shortcuts

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