Skip to content

Commit ffb0a9f

Browse files
committed
disable hard eviction by default
1 parent 17c3fc4 commit ffb0a9f

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

pkg/cluster/internal/kubeadm/config.go

+27-2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,17 @@ apiServerExtraVolumes:
9090
# so we need to ensure the cert is valid for localhost so we can talk
9191
# to the cluster after rewriting the kubeconfig to point to localhost
9292
apiServerCertSANs: [localhost]
93+
kubeletConfiguration:
94+
baseConfig:
95+
# disable disk resource management by default
96+
# kubelet will see the host disk that the inner container runtime
97+
# is ultimately backed by and attempt to recover disk space.
98+
# we don't want that.
99+
imageGCHighThresholdPercent: 100
100+
evictionHard:
101+
nodefs.available: "0%"
102+
nodefs.inodesFree: "0%"
103+
imagefs.available: "0%"
93104
`
94105

95106
// ConfigTemplateAlphaV3 is the kubadm config template for API version v1alpha3
@@ -128,9 +139,16 @@ apiEndpoint:
128139
apiVersion: kubeadm.k8s.io/v1alpha3
129140
kind: JoinConfiguration
130141
---
131-
# no-op entry that exists soley so it can be patched
132142
apiVersion: kubelet.config.k8s.io/v1beta1
133143
kind: KubeletConfiguration
144+
# disable disk resource management by default
145+
# kubelet will see the host disk that the inner container runtime
146+
# is ultimately backed by and attempt to recover disk space. we don't want that.
147+
imageGCHighThresholdPercent: 100
148+
evictionHard:
149+
nodefs.available: "0%"
150+
nodefs.inodesFree: "0%"
151+
imagefs.available: "0%"
134152
---
135153
# no-op entry that exists soley so it can be patched
136154
apiVersion: kubeproxy.config.k8s.io/v1alpha1
@@ -166,9 +184,16 @@ localAPIEndpoint:
166184
apiVersion: kubeadm.k8s.io/v1beta1
167185
kind: JoinConfiguration
168186
---
169-
# no-op entry that exists soley so it can be patched
170187
apiVersion: kubelet.config.k8s.io/v1beta1
171188
kind: KubeletConfiguration
189+
# disable disk resource management by default
190+
# kubelet will see the host disk that the inner container runtime
191+
# is ultimately backed by and attempt to recover disk space. we don't want that.
192+
imageGCHighThresholdPercent: 100
193+
evictionHard:
194+
nodefs.available: "0%"
195+
nodefs.inodesFree: "0%"
196+
imagefs.available: "0%"
172197
---
173198
# no-op entry that exists soley so it can be patched
174199
apiVersion: kubeproxy.config.k8s.io/v1alpha1

0 commit comments

Comments
 (0)