39
39
# Updates settings relevant to the kubelet after TLS bootstrap"
40
40
kubeadm init phase kubelet-finalize all --config
41
41
` )
42
- // TODO: remove with 'experimental-cert-rotation'.
43
- // https://github.com/kubernetes/kubeadm/issues/3046
44
- enableClientCertRotationRun = false
45
42
)
46
43
47
44
// NewKubeletFinalizePhase creates a kubeadm workflow phase that updates settings
@@ -65,43 +62,14 @@ func NewKubeletFinalizePhase() workflow.Phase {
65
62
InheritFlags : []string {options .CfgPath , options .CertificatesDir , options .DryRun },
66
63
Run : runKubeletFinalizeEnableClientCertRotation ,
67
64
},
68
- // TODO: remove this phase in 1.32.
69
- // also remove the "enableClientCertRotationRun" variable.
70
- // https://github.com/kubernetes/kubeadm/issues/3046
71
- {
72
- Name : "experimental-cert-rotation" ,
73
- Short : "Enable kubelet client certificate rotation (DEPRECATED: use 'enable-client-cert-rotation' instead)" ,
74
- InheritFlags : []string {options .CfgPath , options .CertificatesDir , options .DryRun },
75
- Run : runKubeletFinalizeEnableClientCertRotationWrapped ,
76
- },
77
65
},
78
66
}
79
67
}
80
68
81
- // runKubeletFinalizeEnableClientCertRotationWrapped wraps runKubeletFinalizeEnableClientCertRotation
82
- // and prints a deprecation message when the phase is executed directly. If 'all' is used this
83
- // function should just return nil because 'enable-client-cert-rotation' sets 'enableClientCertRotationRun'.
84
- // TODO: remove in 1.32.
85
- // https://github.com/kubernetes/kubeadm/issues/3046
86
- func runKubeletFinalizeEnableClientCertRotationWrapped (c workflow.RunData ) error {
87
- if enableClientCertRotationRun {
88
- return nil
89
- }
90
- klog .Warning ("The phase 'experimental-cert-rotation' is deprecated and will be removed in a future release. " +
91
- "Use 'enable-client-cert-rotation' instead" )
92
- return runKubeletFinalizeEnableClientCertRotation (c )
93
- }
94
-
95
69
// runKubeletFinalizeEnableClientCertRotation detects if the kubelet certificate rotation is enabled
96
70
// and updates the kubelet.conf file to point to a rotatable certificate and key for the
97
71
// Node user.
98
72
func runKubeletFinalizeEnableClientCertRotation (c workflow.RunData ) error {
99
- // Set 'enableClientCertRotationRun' to make sure that if 'all' is called,
100
- // runKubeletFinalizeEnableClientCertRotationWrapped will return nil early.
101
- // TODO: remove in 1.32.
102
- // https://github.com/kubernetes/kubeadm/issues/3046
103
- enableClientCertRotationRun = true
104
-
105
73
data , ok := c .(InitData )
106
74
if ! ok {
107
75
return errors .New ("kubelet-finalize phase invoked with an invalid data struct" )
0 commit comments