Skip to content

Commit 780f29f

Browse files
committed
docs: update eviction-max-pod-grace-period description
The documentation for eviction-max-pod-grace-period parameter claimed that negative values would defer to the pod's specified grace period. However, the current implementation does not honor this behavior. This commit updates the documentation to accurately reflect the actual behavior. Fixes kubernetes#118172
1 parent 35d098a commit 780f29f

File tree

3 files changed

+76
-1
lines changed

3 files changed

+76
-1
lines changed

cmd/kubelet/app/options/options.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ func AddKubeletConfigFlags(mainfs *pflag.FlagSet, c *kubeletconfig.KubeletConfig
488488
fs.Var(cliflag.NewLangleSeparatedMapStringString(&c.EvictionSoft), "eviction-soft", "A set of eviction thresholds (e.g. memory.available<1.5Gi) that if met over a corresponding grace period would trigger a pod eviction.")
489489
fs.Var(cliflag.NewMapStringString(&c.EvictionSoftGracePeriod), "eviction-soft-grace-period", "A set of eviction grace periods (e.g. memory.available=1m30s) that correspond to how long a soft eviction threshold must hold before triggering a pod eviction.")
490490
fs.DurationVar(&c.EvictionPressureTransitionPeriod.Duration, "eviction-pressure-transition-period", c.EvictionPressureTransitionPeriod.Duration, "Duration for which the kubelet has to wait before transitioning out of an eviction pressure condition.")
491-
fs.Int32Var(&c.EvictionMaxPodGracePeriod, "eviction-max-pod-grace-period", c.EvictionMaxPodGracePeriod, "Maximum allowed grace period (in seconds) to use when terminating pods in response to a soft eviction threshold being met. If negative, defer to pod specified value.")
491+
fs.Int32Var(&c.EvictionMaxPodGracePeriod, "eviction-max-pod-grace-period", c.EvictionMaxPodGracePeriod, "Maximum allowed grace period (in seconds) to use when terminating pods in response to a soft eviction threshold being met. " + "Note: The current implementation does not honor negative values as intended - pods are terminated immediately regardless of their specified terminationGracePeriodSeconds.")
492492
fs.Var(cliflag.NewMapStringString(&c.EvictionMinimumReclaim), "eviction-minimum-reclaim", "A set of minimum reclaims (e.g. imagefs.available=2Gi) that describes the minimum amount of resource the kubelet will reclaim when performing a pod eviction if that resource is under pressure.")
493493
fs.Int32Var(&c.PodsPerCore, "pods-per-core", c.PodsPerCore, "Number of Pods per core that can run on this Kubelet. The total number of Pods on this Kubelet cannot exceed max-pods, so max-pods will be used if this calculation results in a larger number of Pods allowed on the Kubelet. A value of 0 disables this limit.")
494494
fs.BoolVar(&c.ProtectKernelDefaults, "protect-kernel-defaults", c.ProtectKernelDefaults, "Default kubelet behaviour for kernel tuning. If set, kubelet errors if any of kernel tunables is different than kubelet defaults.")

metrics-server-config.yaml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
labels:
5+
k8s-app: metrics-server
6+
name: metrics-server
7+
namespace: kube-system
8+
---
9+
apiVersion: rbac.authorization.k8s.io/v1
10+
kind: ClusterRole
11+
metadata:
12+
labels:
13+
k8s-app: metrics-server
14+
name: system:metrics-server
15+
rules:
16+
- apiGroups: [""]
17+
resources: ["pods", "nodes", "nodes/stats", "namespaces", "configmaps"]
18+
verbs: ["get", "list", "watch"]
19+
---
20+
apiVersion: rbac.authorization.k8s.io/v1
21+
kind: ClusterRoleBinding
22+
metadata:
23+
labels:
24+
k8s-app: metrics-server
25+
name: system:metrics-server
26+
roleRef:
27+
apiGroup: rbac.authorization.k8s.io
28+
kind: ClusterRole
29+
name: system:metrics-server
30+
subjects:
31+
- kind: ServiceAccount
32+
name: metrics-server
33+
namespace: kube-system
34+
---
35+
apiVersion: apps/v1
36+
kind: Deployment
37+
metadata:
38+
labels:
39+
k8s-app: metrics-server
40+
name: metrics-server
41+
namespace: kube-system
42+
spec:
43+
selector:
44+
matchLabels:
45+
k8s-app: metrics-server
46+
template:
47+
metadata:
48+
labels:
49+
k8s-app: metrics-server
50+
spec:
51+
serviceAccountName: metrics-server
52+
containers:
53+
- args:
54+
- --cert-dir=/tmp
55+
- --secure-port=4443
56+
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
57+
- --kubelet-use-node-status-port
58+
- --metric-resolution=15s
59+
- --kubelet-insecure-tls
60+
image: registry.k8s.io/metrics-server/metrics-server:v0.6.4
61+
name: metrics-server

test-pod.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: memory-test-pod
5+
spec:
6+
terminationGracePeriodSeconds: 30
7+
containers:
8+
- name: memory-test-container
9+
image: nginx
10+
resources:
11+
requests:
12+
memory: "64Mi"
13+
limits:
14+
memory: "128Mi"

0 commit comments

Comments
 (0)