Skip to content

Commit 9089568

Browse files
authored
Merge pull request kubernetes#91780 from liggitt/csr-v1-rotate-kubelet-client
CSR v1 - promote RotateKubeletClientCertificate to GA
2 parents 1117410 + 71d77b5 commit 9089568

File tree

5 files changed

+5
-9
lines changed

5 files changed

+5
-9
lines changed

cmd/kubelet/app/server.go

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

pkg/features/kube_features.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ const (
7878

7979
// owner: @mikedanese
8080
// beta: v1.8
81+
// ga: v1.19
8182
//
8283
// Automatically renews the client certificate used for communicating with
8384
// the API server as the certificate approaches expiration.
@@ -587,7 +588,7 @@ var defaultKubernetesFeatureGates = map[featuregate.Feature]featuregate.FeatureS
587588
DevicePlugins: {Default: true, PreRelease: featuregate.Beta},
588589
TaintBasedEvictions: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.19
589590
RotateKubeletServerCertificate: {Default: true, PreRelease: featuregate.Beta},
590-
RotateKubeletClientCertificate: {Default: true, PreRelease: featuregate.Beta},
591+
RotateKubeletClientCertificate: {Default: true, PreRelease: featuregate.GA, LockToDefault: true}, // remove in 1.20
591592
LocalStorageCapacityIsolation: {Default: true, PreRelease: featuregate.Beta},
592593
Sysctls: {Default: true, PreRelease: featuregate.Beta},
593594
EphemeralContainers: {Default: false, PreRelease: featuregate.Alpha},

pkg/kubelet/apis/config/types.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ type KubeletConfiguration struct {
122122
TLSMinVersion string
123123
// rotateCertificates enables client certificate rotation. The Kubelet will request a
124124
// new certificate from the certificates.k8s.io API. This requires an approver to approve the
125-
// certificate signing requests. The RotateKubeletClientCertificate feature
126-
// must be enabled.
125+
// certificate signing requests.
127126
RotateCertificates bool
128127
// serverTLSBootstrap enables server certificate bootstrap. Instead of self
129128
// signing a serving certificate, the Kubelet will request a certificate from

pkg/kubelet/apis/config/validation/validation.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,6 @@ func ValidateKubeletConfiguration(kc *kubeletconfig.KubeletConfiguration) error
110110
if kc.RegistryPullQPS < 0 {
111111
allErrors = append(allErrors, fmt.Errorf("invalid configuration: RegistryPullQPS (--registry-qps) %v must not be a negative number", kc.RegistryPullQPS))
112112
}
113-
if kc.RotateCertificates && !localFeatureGate.Enabled(features.RotateKubeletClientCertificate) {
114-
allErrors = append(allErrors, fmt.Errorf("invalid configuration: RotateCertificates %v requires feature gate RotateKubeletClientCertificate", kc.RotateCertificates))
115-
}
116113
if kc.ServerTLSBootstrap && !localFeatureGate.Enabled(features.RotateKubeletServerCertificate) {
117114
allErrors = append(allErrors, fmt.Errorf("invalid configuration: ServerTLSBootstrap %v requires feature gate RotateKubeletServerCertificate", kc.ServerTLSBootstrap))
118115
}

staging/src/k8s.io/kubelet/config/v1beta1/types.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ type KubeletConfiguration struct {
177177
TLSMinVersion string `json:"tlsMinVersion,omitempty"`
178178
// rotateCertificates enables client certificate rotation. The Kubelet will request a
179179
// new certificate from the certificates.k8s.io API. This requires an approver to approve the
180-
// certificate signing requests. The RotateKubeletClientCertificate feature
181-
// must be enabled.
180+
// certificate signing requests.
182181
// Dynamic Kubelet Config (beta): If dynamically updating this field, consider that
183182
// disabling it may disrupt the Kubelet's ability to authenticate with the API server
184183
// after the current certificate expires.

0 commit comments

Comments
 (0)