-
Notifications
You must be signed in to change notification settings - Fork 524
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
k8s settings: kube-reserved, eviction-hard, cpu-manager-policy, allow-unsafe-sysctls #1388
Conversation
Oush above add new model types |
push above fix typo |
Push above improve |
...ces/api/migration/migrations/v1.1.0/kubelet-unsafe-sysctl-and-cpu-manager-policy/src/main.rs
Outdated
Show resolved
Hide resolved
f7f6c59
to
a3eb7d0
Compare
Push above enable |
push above fix migration version. |
push above improve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an overall test, can you make sure that kubelet-config
is still the same for 1.15 + 1.16, 1.17 + 1.18, with 1.19 as an outlier?
❯ sha1sum packages/kubernetes-1.1*/kubelet-config
...
❯ diff -u -p packages/kubernetes-1.1{6,7}/kubelet-config
--- packages/kubernetes-1.16/kubelet-config 2021-03-29 19:27:33.165289932 +0000
+++ packages/kubernetes-1.17/kubelet-config 2021-03-29 19:27:33.165289932 +0000
@@ -36,6 +36,7 @@ cgroupRoot: "/"
runtimeRequestTimeout: 15m
featureGates:
RotateKubeletServerCertificate: true
+ CSIMigration: false
serializeImagePulls: false
serverTLSBootstrap: true
configMapAndSecretChangeDetectionStrategy: Cache
❯ diff -u -p packages/kubernetes-1.1{8,9}/kubelet-config
--- packages/kubernetes-1.18/kubelet-config 2021-03-29 19:27:33.166289937 +0000
+++ packages/kubernetes-1.19/kubelet-config 2021-03-29 19:27:33.166289937 +0000
@@ -42,5 +42,6 @@ serverTLSBootstrap: true
configMapAndSecretChangeDetectionStrategy: Cache
tlsCipherSuites:
- TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
+volumePluginDir: "/var/lib/kubelet/plugins/volume/exec"
maxPods: {{default 110 settings.kubernetes.max-pods}}
staticPodPath: "/etc/kubernetes/static-pods/"
push above improve variable name and improve |
Push above improve number conversion process in Additional Test:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍄
@@ -29,6 +29,20 @@ authorization: | |||
clusterDomain: {{settings.kubernetes.cluster-domain}} | |||
clusterDNS: | |||
- {{settings.kubernetes.cluster-dns-ip}} | |||
{{~#if settings.kubernetes.eviction-hard}} | |||
evictionHard: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome - we've built an AMI with this patch and its working wonderfully. In a followup PR, we'd like to see the evictionSoft
settings exposed, as well as the eviction-max-pod-grace-period
setting. Overall though, this is great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My fork draft PR: gthao313#1
Description of changes:
Add new settings
eviction-hard
,kube-reserved
,allowed-unsafe-sysctls
to k8s. User can specify this setting in userdata.Enable
cpu-manager-policy
to staticAdd migration for
eviction-hard
,kube-reserved
,allowed-unsafe-sysctls
example:
Testing done:
EvictionHardKey
,KubernetesThresholdValue
,ReservedResourcesKey
,KubernetesQuantityValue
, andCpuManagerPolicy
(all passes)Eviction-hard test
Test step1:
Go to control container run
apiclient -u /settings
to check if expected setting is there.Test step2:
ssh to admin contianer and look
etc/kubernetes/kubelet/config
to check if expected config is there.Test step3 - test effected/behavior:
set up eviction threshold to a high value for triggering eviction.
a) Go to EKS to check node condition
b) In admin contianer, check kubelet log by
journalctl -u kubelet
kube-reservd test
Test step1:
Go to control container run apiclient -u /settings to check if expected setting is there.
Test step2:
NodeAllocatable = NodeCapacity - Kube-reserved - system-reserved - eviction-threshold
cpu
[settings.kubernetes.kube-reserved.cpu]
cpu = 1
Allocatable cpu = 2 - 1 = 1
memory
[settings.kubernetes.kube-reserved.Memory]
memory = 1Gi
ephemeral-storage
[settings.kubernetes.kube-reserved.ephemeral-storage]
ephemeral-storage = 1Gi
cpu-manager-policy test
Test step1:
Go to host find
cpu_manager_state
allowed-unsafe-sysctls test
Test step1:
Go to control container run apiclient -u /settings to check if expected setting is there.
Test step2:
Go to kubelet-config to check if desired result is there.
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.