Promote RotateKubeletClientCertificate to GA

This commit is contained in:
Jordan Liggitt 2020-06-04 12:10:39 -04:00
parent fbcd0f84d8
commit 71d77b54fd
5 changed files with 5 additions and 9 deletions

View File

@ -806,7 +806,7 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, featureGate f
// buildKubeletClientConfig constructs the appropriate client config for the kubelet depending on whether // buildKubeletClientConfig constructs the appropriate client config for the kubelet depending on whether
// bootstrapping is enabled or client certificate rotation is enabled. // bootstrapping is enabled or client certificate rotation is enabled.
func buildKubeletClientConfig(s *options.KubeletServer, nodeName types.NodeName) (*restclient.Config, func(), error) { func buildKubeletClientConfig(s *options.KubeletServer, nodeName types.NodeName) (*restclient.Config, func(), error) {
if s.RotateCertificates && utilfeature.DefaultFeatureGate.Enabled(features.RotateKubeletClientCertificate) { if s.RotateCertificates {
// Rules for client rotation and the handling of kube config files: // Rules for client rotation and the handling of kube config files:
// //
// 1. If the client provides only a kubeconfig file, we must use that as the initial client // 1. If the client provides only a kubeconfig file, we must use that as the initial client

View File

@ -78,6 +78,7 @@ const (
// owner: @mikedanese // owner: @mikedanese
// beta: v1.8 // beta: v1.8
// ga: v1.19
// //
// Automatically renews the client certificate used for communicating with // Automatically renews the client certificate used for communicating with
// the API server as the certificate approaches expiration. // the API server as the certificate approaches expiration.
@ -593,7 +594,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
DevicePlugins: {Default: true, PreRelease: featuregate.Beta}, DevicePlugins: {Default: true, PreRelease: featuregate.Beta},
TaintBasedEvictions: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.19 TaintBasedEvictions: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.19
RotateKubeletServerCertificate: {Default: true, PreRelease: featuregate.Beta}, RotateKubeletServerCertificate: {Default: true, PreRelease: featuregate.Beta},
RotateKubeletClientCertificate: {Default: true, PreRelease: featuregate.Beta}, RotateKubeletClientCertificate: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
LocalStorageCapacityIsolation: {Default: true, PreRelease: featuregate.Beta}, LocalStorageCapacityIsolation: {Default: true, PreRelease: featuregate.Beta},
Sysctls: {Default: true, PreRelease: featuregate.Beta}, Sysctls: {Default: true, PreRelease: featuregate.Beta},
EphemeralContainers: {Default: false, PreRelease: featuregate.Alpha}, EphemeralContainers: {Default: false, PreRelease: featuregate.Alpha},

View File

@ -122,8 +122,7 @@ type KubeletConfiguration struct {
TLSMinVersion string TLSMinVersion string
// rotateCertificates enables client certificate rotation. The Kubelet will request a // rotateCertificates enables client certificate rotation. The Kubelet will request a
// new certificate from the certificates.k8s.io API. This requires an approver to approve the // new certificate from the certificates.k8s.io API. This requires an approver to approve the
// certificate signing requests. The RotateKubeletClientCertificate feature // certificate signing requests.
// must be enabled.
RotateCertificates bool RotateCertificates bool
// serverTLSBootstrap enables server certificate bootstrap. Instead of self // serverTLSBootstrap enables server certificate bootstrap. Instead of self
// signing a serving certificate, the Kubelet will request a certificate from // signing a serving certificate, the Kubelet will request a certificate from

View File

@ -110,9 +110,6 @@ func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration) error
if kc.RegistryPullQPS < 0 { if kc.RegistryPullQPS < 0 {
allErrors = append(allErrors, fmt.Errorf("invalid configuration: RegistryPullQPS (--registry-qps) %v must not be a negative number", kc.RegistryPullQPS)) allErrors = append(allErrors, fmt.Errorf("invalid configuration: RegistryPullQPS (--registry-qps) %v must not be a negative number", kc.RegistryPullQPS))
} }
if kc.RotateCertificates && !localFeatureGate.Enabled(features.RotateKubeletClientCertificate) {
allErrors = append(allErrors, fmt.Errorf("invalid configuration: RotateCertificates %v requires feature gate RotateKubeletClientCertificate", kc.RotateCertificates))
}
if kc.ServerTLSBootstrap && !localFeatureGate.Enabled(features.RotateKubeletServerCertificate) { if kc.ServerTLSBootstrap && !localFeatureGate.Enabled(features.RotateKubeletServerCertificate) {
allErrors = append(allErrors, fmt.Errorf("invalid configuration: ServerTLSBootstrap %v requires feature gate RotateKubeletServerCertificate", kc.ServerTLSBootstrap)) allErrors = append(allErrors, fmt.Errorf("invalid configuration: ServerTLSBootstrap %v requires feature gate RotateKubeletServerCertificate", kc.ServerTLSBootstrap))
} }

View File

@ -177,8 +177,7 @@ type KubeletConfiguration struct {
TLSMinVersion string `json:"tlsMinVersion,omitempty"` TLSMinVersion string `json:"tlsMinVersion,omitempty"`
// rotateCertificates enables client certificate rotation. The Kubelet will request a // rotateCertificates enables client certificate rotation. The Kubelet will request a
// new certificate from the certificates.k8s.io API. This requires an approver to approve the // new certificate from the certificates.k8s.io API. This requires an approver to approve the
// certificate signing requests. The RotateKubeletClientCertificate feature // certificate signing requests.
// must be enabled.
// Dynamic Kubelet Config (beta): If dynamically updating this field, consider that // Dynamic Kubelet Config (beta): If dynamically updating this field, consider that
// disabling it may disrupt the Kubelet's ability to authenticate with the API server // disabling it may disrupt the Kubelet's ability to authenticate with the API server
// after the current certificate expires. // after the current certificate expires.