v1beta1

package
v0.37.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 3,175

Documentation

Overview

Package policy is for any kind of policy object. Suitable examples, even if they aren't all here, are PodDisruptionBudget, NetworkPolicy, etc.

Index

Constants

View Source
const (
	// DisruptionAllowedCondition is a condition set by the disruption controller
	// that signal whether any of the pods covered by the PDB can be disrupted.
	DisruptionAllowedCondition = "DisruptionAllowed"

	// SyncFailedReason is set on the DisruptionAllowed condition if reconcile
	// of the PDB failed and therefore disruption of pods are not allowed.
	SyncFailedReason = "SyncFailed"
	// SufficientPodsReason is set on the DisruptionAllowed condition if there are
	// more pods covered by the PDB than required and at least one can be disrupted.
	SufficientPodsReason = "SufficientPods"
	// InsufficientPodsReason is set on the DisruptionAllowed condition if the number
	// of pods are equal to or fewer than required by the PDB.
	InsufficientPodsReason = "InsufficientPods"
)
View Source
const GroupName = "policy"

GroupName is the group name use in this package

Variables

View Source
var (
	ErrInvalidLengthGenerated        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenerated          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenerated = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// TODO: move SchemeBuilder with zz_generated.deepcopy.go to k8s.io/api.
	// localSchemeBuilder and AddToScheme will stay in k8s.io/kubernetes.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type Eviction

type Eviction struct {
	metav1.TypeMeta `json:""`

	// metadata describes the pod that is being evicted.
	// +optional
	// +k8s:opaqueType
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// deleteOptions may be provided
	// +optional
	DeleteOptions *metav1.DeleteOptions `json:"deleteOptions,omitempty" protobuf:"bytes,2,opt,name=deleteOptions"`
}

Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods/<pod name>/evictions.

func (*Eviction) APILifecycleDeprecated added in v0.19.0

func (in *Eviction) APILifecycleDeprecated() (major, minor int)

APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.

func (*Eviction) APILifecycleIntroduced added in v0.19.0

func (in *Eviction) APILifecycleIntroduced() (major, minor int)

APILifecycleIntroduced is an autogenerated function, returning the release in which the API struct was introduced as int versions of major and minor for comparison. It is controlled by "k8s:prerelease-lifecycle-gen:introduced" tags in types.go.

func (*Eviction) APILifecycleRemoved added in v0.19.0

func (in *Eviction) APILifecycleRemoved() (major, minor int)

APILifecycleRemoved is an autogenerated function, returning the release in which the API is no longer served as int versions of major and minor for comparison. It is controlled by "k8s:prerelease-lifecycle-gen:removed" tags in types.go or "k8s:prerelease-lifecycle-gen:deprecated" plus three minor.

func (*Eviction) DeepCopy

func (in *Eviction) DeepCopy() *Eviction

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

func (*Eviction) DeepCopyInto

func (in *Eviction) DeepCopyInto(out *Eviction)

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

func (*Eviction) DeepCopyObject

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

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

func (*Eviction) Marshal

func (m *Eviction) Marshal() (dAtA []byte, err error)

func (*Eviction) MarshalTo

func (m *Eviction) MarshalTo(dAtA []byte) (int, error)

func (*Eviction) MarshalToSizedBuffer added in v0.16.4

func (m *Eviction) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (Eviction) OpenAPIModelName added in v0.35.0

func (in Eviction) OpenAPIModelName() string

OpenAPIModelName returns the OpenAPI model name for this type.

func (*Eviction) Reset

func (m *Eviction) Reset()

func (*Eviction) Size

func (m *Eviction) Size() (n int)

func (*Eviction) String

func (this *Eviction) String() string

func (Eviction) SwaggerDoc

func (Eviction) SwaggerDoc() map[string]string

func (*Eviction) Unmarshal

func (m *Eviction) Unmarshal(dAtA []byte) error

type PodDisruptionBudget

type PodDisruptionBudget struct {
	metav1.TypeMeta `json:""`

	// metadata is the standard object's metadata.
	// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`

	// spec is the specification of the desired behavior of the PodDisruptionBudget.
	// +optional
	Spec PodDisruptionBudgetSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"`
	// status is the most recently observed status of the PodDisruptionBudget.
	// +optional
	Status PodDisruptionBudgetStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"`
}

PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods +k8s:supportsSubresource="/status"

func (*PodDisruptionBudget) APILifecycleDeprecated added in v0.19.0

func (in *PodDisruptionBudget) APILifecycleDeprecated() (major, minor int)

APILifecycleDeprecated is an autogenerated function, returning the release in which the API struct was or will be deprecated as int versions of major and minor for comparison. It is controlled by "k8s:prerelease-lifecycle-gen:deprecated" tags in types.go or "k8s:prerelease-lifecycle-gen:introduced" plus three minor.

func (*PodDisruptionBudget) APILifecycleIntroduced