Skip to content

Commit 26a5588

Browse files
committed
Fix upload-certs TLS error by passing kubeadm config
Without --config, kubeadm upload-certs auto-discovers the API server and connects to the container's podman bridge IP instead of the VM cluster IP, causing a certificate validation error (x509: certificate is valid for 10.0.0.x, not 10.89.x.x). Pass --config /etc/kubernetes/kubeadm-config.yaml so kubeadm uses the correct controlPlaneEndpoint from the init config. Assisted-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5289848 commit 26a5588

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/cluster/join.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (c *Cluster) generateJoinCommand(ctx context.Context, cpSSHClient *ssh.Clie
152152
// The command prints log lines to stderr and the 64-char hex key on stdout.
153153
// We avoid piping (which masks the exit code) and extract the key ourselves.
154154
c.logger.Info("Uploading certificates for control-plane join...")
155-
certKeyOutput, err := cpSSHClient.Exec(ctx, "sudo kubeadm init phase upload-certs --upload-certs")
155+
certKeyOutput, err := cpSSHClient.Exec(ctx, "sudo kubeadm init phase upload-certs --upload-certs --config /etc/kubernetes/kubeadm-config.yaml")
156156
if err != nil {
157157
return "", fmt.Errorf("failed to upload certificates: %w", err)
158158
}

0 commit comments

Comments
 (0)