pub

package
v1.0.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

+k8s:openapi-gen=true +kubebuilder:object:generate=true

Index

Constants

View Source
const (
	// InPlaceUpdateReady must be added into template.spec.readinessGates when pod podUpdatePolicy
	// is InPlaceIfPossible or InPlaceOnly. The condition in podStatus will be updated to False before in-place
	// updating and updated to True after the update is finished. This ensures pod to remain at NotReady state while
	// in-place update is happening.
	InPlaceUpdateReady v1.PodConditionType = "InPlaceUpdateReady"

	// InPlaceUpdateStateKey records the state of inplace-update.
	// The value of annotation is InPlaceUpdateState.
	InPlaceUpdateStateKey string = "apps.kruise.io/inplace-update-state"
	// TODO: will be removed since v1.0.0
	InPlaceUpdateStateKeyOld string = "inplace-update-state"

	// InPlaceUpdateGraceKey records the spec that Pod should be updated when
	// grace period ends.
	InPlaceUpdateGraceKey string = "apps.kruise.io/inplace-update-grace"
	// TODO: will be removed since v1.0.0
	InPlaceUpdateGraceKeyOld string = "inplace-update-grace"

	// RuntimeContainerMetaKey is a key in pod annotations. Kruise-daemon should report the
	// states of runtime containers into its value, which is a structure JSON of RuntimeContainerMetaSet type.
	RuntimeContainerMetaKey = "apps.kruise.io/runtime-containers-meta"
)
View Source
const (
	// ContainerLaunchPriorityEnvName is the env name that users have to define in pod container
	// to identity the launch priority of this container.
	ContainerLaunchPriorityEnvName = "KRUISE_CONTAINER_PRIORITY"
	// ContainerLaunchBarrierEnvName is the env name that Kruise webhook will inject into containers
	// if the pod have configured launch priority.
	ContainerLaunchBarrierEnvName = "KRUISE_CONTAINER_BARRIER"

	// ContainerLaunchPriorityKey is the annotation key that users could define in pod annotation
	// to make containers in pod launched by ordinal.
	ContainerLaunchPriorityKey = "apps.kruise.io/container-launch-priority"
	// ContainerLaunchOrdered is the annotation value that indicates containers in pod should be launched by ordinal.
	ContainerLaunchOrdered = "Ordered"
)
View Source
const (
	KruisePodReadyConditionType v1.PodConditionType = "KruisePodReady"
)

Variables

This section is empty.

Functions

func GetInPlaceUpdateGrace added in v0.8.0

func GetInPlaceUpdateGrace(obj metav1.Object) (string, bool)

func GetInPlaceUpdateState added in v0.8.0

func GetInPlaceUpdateState(obj metav1.Object) (string, bool)

func RemoveInPlaceUpdateGrace added in v0.8.0

func RemoveInPlaceUpdateGrace(obj metav1.Object)

Types

type InPlaceUpdateContainerStatus

type InPlaceUpdateContainerStatus struct {
	ImageID string `json:"imageID,omitempty"`
}

InPlaceUpdateContainerStatus records the statuses of the container that are mainly used to determine whether the InPlaceUpdate is completed.

func (*InPlaceUpdateContainerStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InPlaceUpdateContainerStatus.

func (*InPlaceUpdateContainerStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InPlaceUpdateState

type InPlaceUpdateState struct {
	// Revision is the updated revision hash.
	Revision string `json:"revision"`

	// UpdateTimestamp is the time when the in-place update happens.
	UpdateTimestamp metav1.Time `json:"updateTimestamp"`

	// LastContainerStatuses records the before-in-place-update container statuses. It is a map from ContainerName
	// to InPlaceUpdateContainerStatus
	LastContainerStatuses map[string]InPlaceUpdateContainerStatus `json:"lastContainerStatuses"`

	// UpdateEnvFromMetadata indicates there are envs from annotations/labels that should be in-place update.
	UpdateEnvFromMetadata bool `json:"updateEnvFromMetadata,omitempty"`
}

InPlaceUpdateState records latest inplace-update state, including old statuses of containers.

func (*InPlaceUpdateState) DeepCopy

func (in *InPlaceUpdateState) DeepCopy() *InPlaceUpdateState

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InPlaceUpdateState.

func (*InPlaceUpdateState) DeepCopyInto

func (in *InPlaceUpdateState) DeepCopyInto(out *InPlaceUpdateState)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type InPlaceUpdateStrategy

type InPlaceUpdateStrategy struct {
	// GracePeriodSeconds is the timespan between set Pod status to not-ready and update images in Pod spec
	// when in-place update a Pod.
	GracePeriodSeconds int32 `json:"gracePeriodSeconds,omitempty"`
}

InPlaceUpdateStrategy defines the strategies for in-place update.

func (*InPlaceUpdateStrategy) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InPlaceUpdateStrategy.

func (*InPlaceUpdateStrategy) DeepCopyInto

func (in *InPlaceUpdateStrategy) DeepCopyInto(out *InPlaceUpdateStrategy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Lifecycle

type Lifecycle struct {
	// PreDelete is the hook before Pod to be deleted.
	PreDelete *LifecycleHook `json:"preDelete,omitempty"`
	// InPlaceUpdate is the hook before Pod to update and after Pod has been updated.
	InPlaceUpdate *LifecycleHook `json:"inPlaceUpdate,omitempty"`
}

Lifecycle contains the hooks for Pod lifecycle.

func (*Lifecycle) DeepCopy

func (in *Lifecycle) DeepCopy() *Lifecycle

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Lifecycle.

func (*Lifecycle) DeepCopyInto

func (in *Lifecycle) DeepCopyInto(out *Lifecycle)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LifecycleHook

type LifecycleHook struct {
	LabelsHandler     map[string]string `json:"labelsHandler,omitempty"`
	FinalizersHandler []string          `json:"finalizersHandler,omitempty"`
}

func (*LifecycleHook) DeepCopy

func (in *LifecycleHook) DeepCopy() *LifecycleHook

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LifecycleHook.

func (*LifecycleHook) DeepCopyInto

func (in *LifecycleHook) DeepCopyInto(out *LifecycleHook)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type LifecycleStateType

type LifecycleStateType string
const (
	LifecycleStateKey     = "lifecycle.apps.kruise.io/state"
	LifecycleTimestampKey = "lifecycle.apps.kruise.io/timestamp"

	LifecycleStateNormal          LifecycleStateType = "Normal"
	LifecycleStatePreparingUpdate LifecycleStateType = "PreparingUpdate"
	LifecycleStateUpdating        LifecycleStateType = "Updating"
	LifecycleStateUpdated         LifecycleStateType = "Updated"
	LifecycleStatePreparingDelete LifecycleStateType = "PreparingDelete"
)

type RuntimeContainerHashes added in v1.0.0

type RuntimeContainerHashes struct {
	// PlainHash is the hash that directly calculated from pod.spec.container[x].
	// Usually it is calculated by Kubelet and will be in annotation of each runtime container.
	PlainHash uint64 `json:"plainHash"`
	// ExtractedEnvFromMetadataHash is the hash that calculated from pod.spec.container[x],
	// whose envs from annotations/labels have already been extracted to the real values.
	ExtractedEnvFromMetadataHash uint64 `json:"extractedEnvFromMetadataHash,omitempty"`
}

RuntimeContainerHashes contains the hashes of such container.

func (*RuntimeContainerHashes) DeepCopy added in v1.0.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeContainerHashes.

func (*RuntimeContainerHashes) DeepCopyInto added in v1.0.0

func (in *RuntimeContainerHashes) DeepCopyInto(out *RuntimeContainerHashes)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuntimeContainerMeta added in v1.0.0

type RuntimeContainerMeta struct {
	Name         string                 `json:"name"`
	ContainerID  string                 `json:"containerID"`
	RestartCount int32                  `json:"restartCount"`
	Hashes       RuntimeContainerHashes `json:"hashes"`
}

RuntimeContainerMeta contains the meta data of a runtime container.

func (*RuntimeContainerMeta) DeepCopy added in v1.0.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeContainerMeta.

func (*RuntimeContainerMeta) DeepCopyInto added in v1.0.0

func (in *RuntimeContainerMeta) DeepCopyInto(out *RuntimeContainerMeta)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RuntimeContainerMetaSet added in v1.0.0

type RuntimeContainerMetaSet struct {
	Containers []RuntimeContainerMeta `json:"containers"`
}

RuntimeContainerMetaSet contains all the containers' meta of the Pod.

func GetRuntimeContainerMetaSet added in v1.0.0

func GetRuntimeContainerMetaSet(obj metav1.Object) (*RuntimeContainerMetaSet, error)

func (*RuntimeContainerMetaSet) DeepCopy added in v1.0.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RuntimeContainerMetaSet.

func (*RuntimeContainerMetaSet) DeepCopyInto added in v1.0.0

func (in *RuntimeContainerMetaSet) DeepCopyInto(out *RuntimeContainerMetaSet)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UpdatePriorityOrderTerm

type UpdatePriorityOrderTerm struct {
	// Calculate priority by value of this key.
	// Values of this key, will be sorted by GetInt(val). GetInt method will find the last int in value,
	// such as getting 5 in value '5', getting 10 in value 'sts-10'.
	OrderedKey string `json:"orderedKey"`
}

UpdatePriorityOrder defines order priority.

func (*UpdatePriorityOrderTerm) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdatePriorityOrderTerm.

func (*UpdatePriorityOrderTerm) DeepCopyInto

func (in *UpdatePriorityOrderTerm) DeepCopyInto(out *UpdatePriorityOrderTerm)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UpdatePriorityStrategy

type UpdatePriorityStrategy struct {
	// Order priority terms, pods will be sorted by the value of orderedKey.
	// For example:
	// “`
	// orderPriority:
	// - orderedKey: key1
	// - orderedKey: key2
	// “`
	// First, all pods which have key1 in labels will be sorted by the value of key1.
	// Then, the left pods which have no key1 but have key2 in labels will be sorted by
	// the value of key2 and put behind those pods have key1.
	OrderPriority []UpdatePriorityOrderTerm `json:"orderPriority,omitempty"`
	// Weight priority terms, pods will be sorted by the sum of all terms weight.
	WeightPriority []UpdatePriorityWeightTerm `json:"weightPriority,omitempty"`
}

UpdatePriorityStrategy is the strategy to define priority for pods update. Only one of orderPriority and weightPriority can be set.

func (*UpdatePriorityStrategy) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdatePriorityStrategy.

func (*UpdatePriorityStrategy) DeepCopyInto

func (in *UpdatePriorityStrategy) DeepCopyInto(out *UpdatePriorityStrategy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*UpdatePriorityStrategy) FieldsValidation

func (strategy *UpdatePriorityStrategy) FieldsValidation() error

FieldsValidation checks invalid fields in UpdatePriorityStrategy.

type UpdatePriorityWeightTerm

type UpdatePriorityWeightTerm struct {
	// Weight associated with matching the corresponding matchExpressions, in the range 1-100.
	Weight int32 `json:"weight"`
	// MatchSelector is used to select by pod's labels.
	MatchSelector metav1.LabelSelector `json:"matchSelector"`
}

UpdatePriorityWeightTerm defines weight priority.

func (*UpdatePriorityWeightTerm) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpdatePriorityWeightTerm.

func (*UpdatePriorityWeightTerm) DeepCopyInto

func (in *UpdatePriorityWeightTerm) DeepCopyInto(out *UpdatePriorityWeightTerm)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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