Skip to content

Commit

Permalink
Add field for KubeletConfiguration and Regenerate
Browse files Browse the repository at this point in the history
Kubernetes-commit: d82f6069708ff25ecff48464bee82bc570b55641
  • Loading branch information
wzshiming authored and k8s-publishing-bot committed Nov 17, 2021
1 parent a5e91e2 commit 0dc0452
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
37 changes: 37 additions & 0 deletions config/v1beta1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,35 @@ type KubeletConfiguration struct {
// +featureGate=GracefulNodeShutdown
// +optional
ShutdownGracePeriodCriticalPods metav1.Duration `json:"shutdownGracePeriodCriticalPods,omitempty"`
// shutdownGracePeriodByPodPriority specifies the shutdown grace period for Pods based
// on their associated priority class value.
// When a shutdown request is received, the Kubelet will initiate shutdown on all pods
// running on the node with a grace period that depends on the priority of the pod,
// and then wait for all pods to exit.
// Each entry in the array represents the graceful shutdown time a pod with a priority
// class value that lies in the range of that value and the next higher entry in the
// list when the node is shutting down.
// For example, to allow critical pods 10s to shutdown, priority>=10000 pods 20s to
// shutdown, and all remaining pods 30s to shutdown.
//
// shutdownGracePeriodByPodPriority:
// - priority: 2000000000
// shutdownGracePeriodSeconds: 10
// - priority: 10000
// shutdownGracePeriodSeconds: 20
// - priority: 0
// shutdownGracePeriodSeconds: 30
//
// The time the Kubelet will wait before exiting will at most be the maximum of all
// shutdownGracePeriodSeconds for each priority class range represented on the node.
// When all pods have exited or reached their grace periods, the Kubelet will release
// the shutdown inhibit lock.
// Requires the GracefulNodeShutdown feature gate to be enabled.
// This configuration must be empty if either ShutdownGracePeriod or ShutdownGracePeriodCriticalPods is set.
// Default: nil
// +featureGate=GracefulNodeShutdownBasedOnPodPriority
// +optional
ShutdownGracePeriodByPodPriority []ShutdownGracePeriodByPodPriority `json:"shutdownGracePeriodByPodPriority,omitempty"`
// reservedMemory specifies a comma-separated list of memory reservations for NUMA nodes.
// The parameter makes sense only in the context of the memory manager feature.
// The memory manager will not allocate reserved memory for container workloads.
Expand Down Expand Up @@ -1136,6 +1165,14 @@ type MemoryReservation struct {
Limits v1.ResourceList `json:"limits"`
}

// ShutdownGracePeriodByPodPriority specifies the shutdown grace period for Pods based on their associated priority class value
type ShutdownGracePeriodByPodPriority struct {
// priority is the priority value associated with the shutdown grace period
Priority int32 `json:"priority"`
// shutdownGracePeriodSeconds is the shutdown grace period in seconds
ShutdownGracePeriodSeconds int64 `json:"shutdownGracePeriodSeconds"`
}

type MemorySwapConfiguration struct {
// swapBehavior configures swap memory available to container workloads. May be one of
// "", "LimitedSwap": workload combined memory and swap usage cannot exceed pod memory limit
Expand Down
21 changes: 21 additions & 0 deletions config/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0dc0452

Please sign in to comment.