Skip to content

Commit 8943e44

Browse files
committed
kubeadm: deprecate the flag --use-api for cert renewal
The KCM is moving to means of only singing apiserver (kubelet) client and kubelet serving certificates. See: https://github.com/kubernetes/enhancements/blob/master/keps/sig-auth/20190607-certificates-api.md#signers Up until now the experimental kubeadm functionality '--use-api' under "kubeadm alpha certs renew" was using the KCM to sign *any* certficate as long as the KCM has the root CA cert/key. Post discussions with the kubeadm maintainers, it was decided that this functionality should be removed from kubeadm due to the requirement to have external signers for renewing the common control-plane certificates that kubeadm manages.
1 parent e865c0b commit 8943e44

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/kubeadm/app/cmd/alpha/certs.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var (
4343
genericCertRenewLongDesc = cmdutil.LongDesc(`
4444
Renew the %s.
4545
46-
Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will
46+
Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will
4747
be based on the existing file/certificates, there is no need to resupply them.
4848
4949
Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative
@@ -208,7 +208,12 @@ func addRenewFlags(cmd *cobra.Command, flags *renewFlags) {
208208
options.AddKubeConfigFlag(cmd.Flags(), &flags.kubeconfigPath)
209209
options.AddCSRFlag(cmd.Flags(), &flags.csrOnly)
210210
options.AddCSRDirFlag(cmd.Flags(), &flags.csrPath)
211+
// TODO: remove the flag and related logic once legacy signers are removed,
212+
// potentially with the release of certificates.k8s.io/v1:
213+
// https://github.com/kubernetes/kubeadm/issues/2047
211214
cmd.Flags().BoolVar(&flags.useAPI, "use-api", flags.useAPI, "Use the Kubernetes certificate API to renew certificates")
215+
cmd.Flags().MarkDeprecated("use-api", "certificate renewal from kubeadm using the Kubernetes API "+
216+
"is deprecated and will be removed when 'certificates.k8s.io/v1' releases.")
212217
}
213218

214219
func renewCert(flags *renewFlags, kdir string, internalcfg *kubeadmapi.InitConfiguration, handler *renewal.CertificateRenewHandler) error {

0 commit comments

Comments
 (0)