v1alpha1

package
v1.6.0 Latest Latest
Warning

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

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

Documentation

Overview

+k8s:openapi-gen=true +groupName=policy.kruise.io

Package v1alpha1 contains API Schema definitions for the policy v1alpha1 API group +kubebuilder:object:generate=true +groupName=policy.kruise.io

Index

Constants

View Source
const (
	// PubProtectOperationAnnotation indicates the pub protected Operation[DELETE,UPDATE,EVICT]
	// if annotations[kruise.io/pub-protect-operations]=EVICT indicates the pub only protect evict pod
	// if the annotations do not exist, the default DELETE,EVICT,UPDATE are protected
	PubProtectOperationAnnotation = "kruise.io/pub-protect-operations"
	// pod webhook operation
	PubUpdateOperation PubOperation = "UPDATE"
	PubDeleteOperation PubOperation = "DELETE"
	PubEvictOperation  PubOperation = "EVICT"
	// PubProtectTotalReplicas indicates the pub protected total replicas, rather than workload.spec.replicas.
	// and must be used with pub.spec.selector.
	PubProtectTotalReplicas = "pub.kruise.io/protect-total-replicas"
	// Marked the pod will not be pub-protected, solving the scenario of force pod deletion
	PodPubNoProtectionAnnotation = "pub.kruise.io/no-protect"
)
View Source
const (
	// DeletionProtectionKey is a key in object labels and its value can be Always and Cascading.
	// Currently supports Namespace, CustomResourcesDefinition, Deployment, StatefulSet, ReplicaSet, CloneSet, Advanced StatefulSet, UnitedDeployment.
	DeletionProtectionKey = "policy.kruise.io/delete-protection"

	// DeletionProtectionTypeAlways indicates this object will always be forbidden to be deleted, unless the label is removed.
	DeletionProtectionTypeAlways = "Always"
	// DeletionProtectionTypeCascading indicates this object will be forbidden to be deleted, if it has active resources owned.
	DeletionProtectionTypeCascading = "Cascading"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "policy.kruise.io", Version: "v1alpha1"}

	SchemeGroupVersion = GroupVersion

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource is required by pkg/client/listers/...

Types

type PodUnavailableBudget added in v0.10.0

type PodUnavailableBudget struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   PodUnavailableBudgetSpec   `json:"spec,omitempty"`
	Status PodUnavailableBudgetStatus `json:"status,omitempty"`
}

PodUnavailableBudget is the Schema for the podunavailablebudgets API

func (*PodUnavailableBudget) DeepCopy added in v0.10.0

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

func (*PodUnavailableBudget) DeepCopyInto added in v0.10.0

func (in *PodUnavailableBudget) DeepCopyInto(out *PodUnavailableBudget)

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

func (*PodUnavailableBudget) DeepCopyObject added in v0.10.0

func (in *PodUnavailableBudget) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PodUnavailableBudgetList added in v0.10.0

type PodUnavailableBudgetList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []PodUnavailableBudget `json:"items"`
}

PodUnavailableBudgetList contains a list of PodUnavailableBudget

func (*PodUnavailableBudgetList) DeepCopy added in v0.10.0

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

func (*PodUnavailableBudgetList) DeepCopyInto added in v0.10.0

func (in *PodUnavailableBudgetList) DeepCopyInto(out *PodUnavailableBudgetList)

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

func (*PodUnavailableBudgetList) DeepCopyObject added in v0.10.0

func (in *PodUnavailableBudgetList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type PodUnavailableBudgetSpec added in v0.10.0

type PodUnavailableBudgetSpec struct {
	// Selector label query over pods managed by the budget
	Selector *metav1.LabelSelector `json:"selector,omitempty"`

	// TargetReference contains enough information to let you identify an workload for PodUnavailableBudget
	// Selector and TargetReference are mutually exclusive, TargetReference is priority to take effect
	TargetReference *TargetReference `json:"targetRef,omitempty"`

	// Delete pod, evict pod or update pod specification is allowed if at most "maxUnavailable" pods selected by
	// "selector" or "targetRef"  are unavailable after the above operation for pod.
	// MaxUnavailable and MinAvailable are mutually exclusive, MaxUnavailable is priority to take effect
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable,omitempty"`

	// Delete pod, evict pod or update pod specification is allowed if at least "minAvailable" pods selected by
	// "selector" or "targetRef" will still be available after the above operation for pod.
	MinAvailable *intstr.IntOrString `json:"minAvailable,omitempty"`
}

PodUnavailableBudgetSpec defines the desired state of PodUnavailableBudget

func (*PodUnavailableBudgetSpec) DeepCopy added in v0.10.0

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

func (*PodUnavailableBudgetSpec) DeepCopyInto added in v0.10.0

func (in *PodUnavailableBudgetSpec) DeepCopyInto(out *PodUnavailableBudgetSpec)

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

type PodUnavailableBudgetStatus added in v0.10.0

type PodUnavailableBudgetStatus struct {
	// Most recent generation observed when updating this PUB status. UnavailableAllowed and other
	// status information is valid only if observedGeneration equals to PUB's object generation.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration"`

	// DisruptedPods contains information about pods whose eviction or deletion was
	// processed by the API handler but has not yet been observed by the PodUnavailableBudget.
	// +optional
	DisruptedPods map[string]metav1.Time `json:"disruptedPods,omitempty"`

	// UnavailablePods contains information about pods whose specification changed(inplace-update pod),
	// once pod is available(consistent and ready) again, it will be removed from the list.
	// +optional
	UnavailablePods map[string]metav1.Time `json:"unavailablePods,omitempty"`

	// UnavailableAllowed number of pod unavailable that are currently allowed
	UnavailableAllowed int32 `json:"unavailableAllowed"`

	// CurrentAvailable current number of available pods
	CurrentAvailable int32 `json:"currentAvailable"`

	// DesiredAvailable minimum desired number of available pods
	DesiredAvailable int32 `json:"desiredAvailable"`

	// TotalReplicas total number of pods counted by this unavailable budget
	TotalReplicas int32 `json:"totalReplicas"`
}

PodUnavailableBudgetStatus defines the observed state of PodUnavailableBudget

func (*PodUnavailableBudgetStatus) DeepCopy added in v0.10.0

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

func (*PodUnavailableBudgetStatus) DeepCopyInto added in v0.10.0

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

type PubOperation added in v1.3.0

type PubOperation string

type TargetReference added in v0.10.0

type TargetReference struct {
	// API version of the referent.
	APIVersion string `json:"apiVersion,omitempty"`
	// Kind of the referent.
	Kind string `json:"kind,omitempty"`
	// Name of the referent.
	Name string `json:"name,omitempty"`
}

TargetReference contains enough information to let you identify an workload for PodUnavailableBudget

func (*TargetReference) DeepCopy added in v0.10.0

func (in *TargetReference) DeepCopy() *TargetReference

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

func (*TargetReference) DeepCopyInto added in v0.10.0

func (in *TargetReference) DeepCopyInto(out *TargetReference)

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