rc

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const PMLABEL = "go-k8s-pod-rc"

Variables

This section is empty.

Functions

func GetPodCondition

func GetPodCondition(status *apiv1.PodStatus, conditionType apiv1.PodConditionType) (int, *apiv1.PodCondition)

GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.

func GetPodConditionFromList

func GetPodConditionFromList(conditions []apiv1.PodCondition, conditionType apiv1.PodConditionType) (int, *apiv1.PodCondition)

GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition. Returns -1 and nil if the condition is not present.

func GetPodReadyCondition

func GetPodReadyCondition(status apiv1.PodStatus) *apiv1.PodCondition

Extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.

func IsPodReadyConditionTrue

func IsPodReadyConditionTrue(status apiv1.PodStatus) bool

IsPodReady returns true if a pod is ready; false otherwise.

Types

type ReplicationController

type ReplicationController struct {
	CostLimit     int    //terminationcost over which a pod will not be deleted
	CostPort      int    //port on which to poll for pod termination cost
	CostPath      string //(http)path on which to poll for pod termination cost
	AllowEviction bool   //can a created pod be terminated by the cluster autoscaler
	//SpreadOnNodes true disables the default behavior to try to schedule pods alongside existing ones.
	//The default behavior is to prefer packing nodes with pods in order to more rapidly drain nodes so
	//they can be shut down by the cluster autoscaler. This is useful in case there is a 1-to-1 ratio of
	//pods vs. jobs to execute, but is detrimental in case there are fewer pods than jobs.
	SpreadOnNodes bool
	// contains filtered or unexported fields
}

func New

func New(name, namespace string) (*ReplicationController, error)

func (*ReplicationController) Resize

func (d *ReplicationController) Resize(ctx context.Context, newSize int64) error

func (*ReplicationController) ScaleDown

func (d *ReplicationController) ScaleDown(ctx context.Context, newSize int64) error

func (*ReplicationController) Size

Jump to

Keyboard shortcuts

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