storage

package
v1.31.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 36 Imported by: 32

Documentation

Index

Constants

View Source
const (
	// MaxDisruptedPodSize is the max size of PodDisruptionBudgetStatus.DisruptedPods. API server eviction
	// subresource handler will refuse to evict pods covered by the corresponding PDB
	// if the size of the map exceeds this value. It means a large number of
	// evictions have been approved by the API server but not noticed by the PDB controller yet.
	// This situation should self-correct because the PDB controller removes
	// entries from the map automatically after the PDB DeletionTimeout regardless.
	MaxDisruptedPodSize = 2000
)

Variables

View Source
var EvictionsRetry = wait.Backoff{
	Steps:    20,
	Duration: 500 * time.Millisecond,
	Factor:   1.0,
	Jitter:   0.1,
}

EvictionsRetry is the retry for a conflict where multiple clients are making changes to the same resource.

Functions

This section is empty.

Types

type BindingREST

type BindingREST struct {
	// contains filtered or unexported fields
}

BindingREST implements the REST endpoint for binding pods to nodes when etcd is in use.

func (*BindingREST) Create

func (r *BindingREST) Create(ctx context.Context, name string, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (out runtime.Object, err error)

Create ensures a pod is bound to a specific host.

func (*BindingREST) Destroy added in v1.25.0

func (r *BindingREST) Destroy()

Destroy cleans up resources on shutdown.

func (*BindingREST) NamespaceScoped added in v1.11.0

func (r *BindingREST) NamespaceScoped() bool

NamespaceScoped fulfill rest.Scoper

func (*BindingREST) New

func (r *BindingREST) New() runtime.Object

New creates a new binding resource

func (*BindingREST) PreserveRequestObjectMetaSystemFieldsOnSubresourceCreate added in v1.25.9

func (r *BindingREST) PreserveRequestObjectMetaSystemFieldsOnSubresourceCreate() bool

PreserveRequestObjectMetaSystemFieldsOnSubresourceCreate indicates to a handler that this endpoint requires the UID and ResourceVersion to use as preconditions. Other fields, such as timestamp, are ignored.

type EphemeralContainersREST added in v1.16.0

type EphemeralContainersREST struct {
	// contains filtered or unexported fields
}

EphemeralContainersREST implements the REST endpoint for adding EphemeralContainers

func (*EphemeralContainersREST) Destroy added in v1.25.0

func (r *EphemeralContainersREST) Destroy()

Destroy cleans up resources on shutdown.

func (*EphemeralContainersREST) Get added in v1.16.0

Get retrieves the object from the storage. It is required to support Patch.

func (*EphemeralContainersREST) New added in v1.16.0

New creates a new pod resource

func (*EphemeralContainersREST) Update added in v1.16.0

func (r *EphemeralContainersREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

Update alters the EphemeralContainers field in PodSpec

type EvictionREST

type EvictionREST struct {
	// contains filtered or unexported fields
}

EvictionREST implements the REST endpoint for evicting pods from nodes

func (*EvictionREST) AcceptsGroupVersion added in v1.22.0

func (r *EvictionREST) AcceptsGroupVersion(gv schema.GroupVersion) bool

AcceptsGroupVersion indicates both v1 and v1beta1 Eviction objects are acceptable

func (*EvictionREST) Create

func (r *EvictionREST) Create(ctx context.Context, name string, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (runtime.Object, error)

Create attempts to create a new eviction. That is, it tries to evict a pod.

func (*EvictionREST) Destroy added in v1.25.0

func (r *EvictionREST) Destroy()

Destroy cleans up resources on shutdown.

func (*EvictionREST) GroupVersionKind added in v1.8.3

func (r *EvictionREST) GroupVersionKind(containingGV schema.GroupVersion) schema.GroupVersionKind

GroupVersionKind specifies a particular GroupVersionKind to discovery

func (*EvictionREST) New

func (r *EvictionREST) New() runtime.Object

New creates a new eviction resource

type LegacyBindingREST added in v1.16.0

type LegacyBindingREST struct {
	// contains filtered or unexported fields
}

LegacyBindingREST implements the REST endpoint for binding pods to nodes when etcd is in use.

func (*LegacyBindingREST) Create added in v1.16.0

func (r *LegacyBindingREST) Create(ctx context.Context, obj runtime.Object, createValidation rest.ValidateObjectFunc, options *metav1.CreateOptions) (out runtime.Object, err error)

Create ensures a pod is bound to a specific host.

func (*LegacyBindingREST) Destroy added in v1.25.0

func (r *LegacyBindingREST) Destroy()

Destroy cleans up resources on shutdown.

func (*LegacyBindingREST) GetSingularName added in v1.27.0

func (r *LegacyBindingREST) GetSingularName() string

func (*LegacyBindingREST) NamespaceScoped added in v1.16.0

func (r *LegacyBindingREST) NamespaceScoped() bool

NamespaceScoped fulfill rest.Scoper

func (*LegacyBindingREST) New added in v1.16.0

func (r *LegacyBindingREST) New() runtime.Object

New creates a new binding resource

type PodStorage

type PodStorage struct {
	Pod                 *REST
	Binding             *BindingREST
	LegacyBinding       *LegacyBindingREST
	Eviction            *EvictionREST
	Status              *StatusREST
	EphemeralContainers *EphemeralContainersREST
	Log                 *podrest.LogREST
	Proxy               *podrest.ProxyREST
	Exec                *podrest.ExecREST
	Attach              *podrest.AttachREST
	PortForward         *podrest.PortForwardREST
}

PodStorage includes storage for pods and all sub resources

func NewStorage

func NewStorage(optsGetter generic.RESTOptionsGetter, k client.ConnectionInfoGetter, proxyTransport http.RoundTripper, podDisruptionBudgetClient policyclient.PodDisruptionBudgetsGetter) (PodStorage, error)

NewStorage returns a RESTStorage object that will work against pods.

type REST

type REST struct {
	*genericregistry.Store
	// contains filtered or unexported fields
}

REST implements a RESTStorage for pods

func (*REST) Categories added in v1.7.0

func (r *REST) Categories() []string

Categories implements the CategoriesProvider interface. Returns a list of categories a resource is part of.

func (*REST) ResourceLocation

func (r *REST) ResourceLocation(ctx context.Context, name string) (*url.URL, http.RoundTripper, error)

ResourceLocation returns a pods location from its HostIP

func (*REST) ShortNames

func (r *REST) ShortNames() []string

ShortNames implements the ShortNamesProvider interface. Returns a list of short names for a resource.

type StatusREST

type StatusREST struct {
	// contains filtered or unexported fields
}

StatusREST implements the REST endpoint for changing the status of a pod.

func (*StatusREST) ConvertToTable added in v1.24.0

func (r *StatusREST) ConvertToTable(ctx context.Context, object runtime.Object, tableOptions runtime.Object) (*metav1.Table, error)

func (*StatusREST) Destroy added in v1.25.0

func (r *StatusREST) Destroy()

Destroy cleans up resources on shutdown.

func (*StatusREST) Get

func (r *StatusREST) Get(ctx context.Context, name string, options *metav1.GetOptions) (runtime.Object, error)

Get retrieves the object from the storage. It is required to support Patch.

func (*StatusREST) GetResetFields added in v1.21.0

func (r *StatusREST) GetResetFields() map[fieldpath.APIVersion]*fieldpath.Set

GetResetFields implements rest.ResetFieldsStrategy

func (*StatusREST) New

func (r *StatusREST) New() runtime.Object

New creates a new pod resource

func (*StatusREST) Update

func (r *StatusREST) Update(ctx context.Context, name string, objInfo rest.UpdatedObjectInfo, createValidation rest.ValidateObjectFunc, updateValidation rest.ValidateObjectUpdateFunc, forceAllowCreate bool, options *metav1.UpdateOptions) (runtime.Object, bool, error)

Update alters the status subset of an object.

Jump to

Keyboard shortcuts

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