kubeadm: Improve the kubelet default configuration security-wise
This commit is contained in:
		@@ -79,6 +79,7 @@ func Funcs(codecs runtimeserializer.CodecFactory) []interface{} {
 | 
			
		||||
							Enabled: utilpointer.BoolPtr(false),
 | 
			
		||||
						},
 | 
			
		||||
					},
 | 
			
		||||
					RotateCertificates: true,
 | 
			
		||||
				},
 | 
			
		||||
			}
 | 
			
		||||
			kubeletconfigv1beta1.SetDefaults_KubeletConfiguration(obj.KubeletConfiguration.BaseConfig)
 | 
			
		||||
 
 | 
			
		||||
@@ -247,12 +247,13 @@ func SetDefaults_KubeletConfiguration(obj *MasterConfiguration) {
 | 
			
		||||
	obj.KubeletConfiguration.BaseConfig.Authorization.Mode = kubeletconfigv1beta1.KubeletAuthorizationModeWebhook
 | 
			
		||||
 | 
			
		||||
	// 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
 | 
			
		||||
	// 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
 | 
			
		||||
	obj.KubeletConfiguration.BaseConfig.HealthzBindAddress = "127.0.0.1"
 | 
			
		||||
 
 | 
			
		||||
@@ -210,12 +210,13 @@ func SetDefaults_KubeletConfiguration(obj *MasterConfiguration) {
 | 
			
		||||
	obj.KubeletConfiguration.BaseConfig.Authorization.Mode = kubeletconfigv1beta1.KubeletAuthorizationModeWebhook
 | 
			
		||||
 | 
			
		||||
	// 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
 | 
			
		||||
	// 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
 | 
			
		||||
	obj.KubeletConfiguration.BaseConfig.HealthzBindAddress = "127.0.0.1"
 | 
			
		||||
 
 | 
			
		||||
@@ -130,6 +130,7 @@ KubeletConfiguration:
 | 
			
		||||
    registryBurst: 10
 | 
			
		||||
    registryPullQPS: 5
 | 
			
		||||
    resolvConf: /etc/resolv.conf
 | 
			
		||||
    rotateCertificates: true
 | 
			
		||||
    runtimeRequestTimeout: 2m0s
 | 
			
		||||
    serializeImagePulls: true
 | 
			
		||||
    staticPodPath: /etc/kubernetes/manifests
 | 
			
		||||
 
 | 
			
		||||
@@ -123,6 +123,7 @@ kubeletConfiguration:
 | 
			
		||||
    registryBurst: 10
 | 
			
		||||
    registryPullQPS: 5
 | 
			
		||||
    resolvConf: /etc/resolv.conf
 | 
			
		||||
    rotateCertificates: true
 | 
			
		||||
    runtimeRequestTimeout: 2m0s
 | 
			
		||||
    serializeImagePulls: true
 | 
			
		||||
    staticPodPath: /etc/kubernetes/manifests
 | 
			
		||||
 
 | 
			
		||||
@@ -118,6 +118,7 @@ kubeletConfiguration:
 | 
			
		||||
    registryBurst: 10
 | 
			
		||||
    registryPullQPS: 5
 | 
			
		||||
    resolvConf: /etc/resolv.conf
 | 
			
		||||
    rotateCertificates: true
 | 
			
		||||
    runtimeRequestTimeout: 2m0s
 | 
			
		||||
    serializeImagePulls: true
 | 
			
		||||
    staticPodPath: /etc/kubernetes/manifests
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user