mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
kubeadm: Improve the kubelet default configuration security-wise
This commit is contained in:
parent
65a819338a
commit
efc408944c
@ -79,6 +79,7 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
|
|||||||
Enabled: utilpointer.BoolPtr(false),
|
Enabled: utilpointer.BoolPtr(false),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
RotateCertificates: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
kubeletconfigv1beta1.SetDefaults_KubeletConfiguration(obj.KubeletConfiguration.BaseConfig)
|
kubeletconfigv1beta1.SetDefaults_KubeletConfiguration(obj.KubeletConfiguration.BaseConfig)
|
||||||
|
@ -247,12 +247,13 @@ func SetDefaults_KubeletConfiguration(obj *MasterConfiguration) {
|
|||||||
obj.KubeletConfiguration.BaseConfig.Authorization.Mode = kubeletconfigv1beta1.KubeletAuthorizationModeWebhook
|
obj.KubeletConfiguration.BaseConfig.Authorization.Mode = kubeletconfigv1beta1.KubeletAuthorizationModeWebhook
|
||||||
|
|
||||||
// Let clients using other authentication methods like ServiceAccount tokens also access the kubelet API
|
// Let clients using other authentication methods like ServiceAccount tokens also access the kubelet API
|
||||||
// TODO: Enable in a future PR
|
obj.KubeletConfiguration.BaseConfig.Authentication.Webhook.Enabled = utilpointer.BoolPtr(true)
|
||||||
// obj.KubeletConfiguration.BaseConfig.Authentication.Webhook.Enabled = utilpointer.BoolPtr(true)
|
|
||||||
|
|
||||||
// Disable the readonly port of the kubelet, in order to not expose unnecessary information
|
// Disable the readonly port of the kubelet, in order to not expose unnecessary information
|
||||||
// TODO: Enable in a future PR
|
obj.KubeletConfiguration.BaseConfig.ReadOnlyPort = 0
|
||||||
// obj.KubeletConfiguration.BaseConfig.ReadOnlyPort = 0
|
|
||||||
|
// Enables client certificate rotation for the kubelet
|
||||||
|
obj.KubeletConfiguration.BaseConfig.RotateCertificates = true
|
||||||
|
|
||||||
// Serve a /healthz webserver on localhost:10248 that kubeadm can talk to
|
// Serve a /healthz webserver on localhost:10248 that kubeadm can talk to
|
||||||
obj.KubeletConfiguration.BaseConfig.HealthzBindAddress = "127.0.0.1"
|
obj.KubeletConfiguration.BaseConfig.HealthzBindAddress = "127.0.0.1"
|
||||||
|
@ -210,12 +210,13 @@ func SetDefaults_KubeletConfiguration(obj *MasterConfiguration) {
|
|||||||
obj.KubeletConfiguration.BaseConfig.Authorization.Mode = kubeletconfigv1beta1.KubeletAuthorizationModeWebhook
|
obj.KubeletConfiguration.BaseConfig.Authorization.Mode = kubeletconfigv1beta1.KubeletAuthorizationModeWebhook
|
||||||
|
|
||||||
// Let clients using other authentication methods like ServiceAccount tokens also access the kubelet API
|
// Let clients using other authentication methods like ServiceAccount tokens also access the kubelet API
|
||||||
// TODO: Enable in a future PR
|
obj.KubeletConfiguration.BaseConfig.Authentication.Webhook.Enabled = utilpointer.BoolPtr(true)
|
||||||
// obj.KubeletConfiguration.BaseConfig.Authentication.Webhook.Enabled = utilpointer.BoolPtr(true)
|
|
||||||
|
|
||||||
// Disable the readonly port of the kubelet, in order to not expose unnecessary information
|
// Disable the readonly port of the kubelet, in order to not expose unnecessary information
|
||||||
// TODO: Enable in a future PR
|
obj.KubeletConfiguration.BaseConfig.ReadOnlyPort = 0
|
||||||
// obj.KubeletConfiguration.BaseConfig.ReadOnlyPort = 0
|
|
||||||
|
// Enables client certificate rotation for the kubelet
|
||||||
|
obj.KubeletConfiguration.BaseConfig.RotateCertificates = true
|
||||||
|
|
||||||
// Serve a /healthz webserver on localhost:10248 that kubeadm can talk to
|
// Serve a /healthz webserver on localhost:10248 that kubeadm can talk to
|
||||||
obj.KubeletConfiguration.BaseConfig.HealthzBindAddress = "127.0.0.1"
|
obj.KubeletConfiguration.BaseConfig.HealthzBindAddress = "127.0.0.1"
|
||||||
|
@ -130,6 +130,7 @@ KubeletConfiguration:
|
|||||||
registryBurst: 10
|
registryBurst: 10
|
||||||
registryPullQPS: 5
|
registryPullQPS: 5
|
||||||
resolvConf: /etc/resolv.conf
|
resolvConf: /etc/resolv.conf
|
||||||
|
rotateCertificates: true
|
||||||
runtimeRequestTimeout: 2m0s
|
runtimeRequestTimeout: 2m0s
|
||||||
serializeImagePulls: true
|
serializeImagePulls: true
|
||||||
staticPodPath: /etc/kubernetes/manifests
|
staticPodPath: /etc/kubernetes/manifests
|
||||||
|
@ -123,6 +123,7 @@ kubeletConfiguration:
|
|||||||
registryBurst: 10
|
registryBurst: 10
|
||||||
registryPullQPS: 5
|
registryPullQPS: 5
|
||||||
resolvConf: /etc/resolv.conf
|
resolvConf: /etc/resolv.conf
|
||||||
|
rotateCertificates: true
|
||||||
runtimeRequestTimeout: 2m0s
|
runtimeRequestTimeout: 2m0s
|
||||||
serializeImagePulls: true
|
serializeImagePulls: true
|
||||||
staticPodPath: /etc/kubernetes/manifests
|
staticPodPath: /etc/kubernetes/manifests
|
||||||
|
@ -118,6 +118,7 @@ kubeletConfiguration:
|
|||||||
registryBurst: 10
|
registryBurst: 10
|
||||||
registryPullQPS: 5
|
registryPullQPS: 5
|
||||||
resolvConf: /etc/resolv.conf
|
resolvConf: /etc/resolv.conf
|
||||||
|
rotateCertificates: true
|
||||||
runtimeRequestTimeout: 2m0s
|
runtimeRequestTimeout: 2m0s
|
||||||
serializeImagePulls: true
|
serializeImagePulls: true
|
||||||
staticPodPath: /etc/kubernetes/manifests
|
staticPodPath: /etc/kubernetes/manifests
|
||||||
|
Loading…
Reference in New Issue
Block a user