Skip to content

fix: add client certs for image registry#3122

Merged
ks-ci-bot merged 1 commit into
kubesphere:mainfrom
redscholar:image_registry_client_certs
Jun 2, 2026
Merged

fix: add client certs for image registry#3122
ks-ci-bot merged 1 commit into
kubesphere:mainfrom
redscholar:image_registry_client_certs

Conversation

@redscholar

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

Previously, the image registry client reused the server certificates (image_registry.crt and image_registry.key) for mTLS authentication with the registry, which is not best practice and may cause certificate verification issues in certain scenarios.
This PR makes the following changes:

  1. Generate a dedicated image registry client certificate: Adds a new certificate generation task (image-registry-client.crt and image-registry-client.key) during the cert initialization phase, with CN set to image-registry-client.
  2. Update image registry default configuration: Changes the default paths of image_registry.auth.cert_file and key_file from server certificates to the newly generated client certificates.
  3. Update the network precheck logic: Updates the image registry network connectivity check to use the new client certificate paths for validation.
  4. Synchronize documentation updates: Updates the certificate paths and related comments in both English and Chinese configuration reference docs (docs/en/reference/config.md and docs/zh/config/reference/config.md).

Which issue(s) this PR fixes:

Fixes #

Special notes for reviewers:

- This change affects certificate generation, default configuration, precheck tasks, and documentation. Please ensure all references to `image_registry.crt/key` have been replaced.
- The expiration and generation policy for the dedicated client certificate follow the existing `image_registry` certificate configuration.

Does this PR introduced a user-facing change?

Fix the issue where image registry client authentication reused the server certificate. Now a dedicated client certificate (`image-registry-client.crt` and `image-registry-client.key`) is generated and used instead.

Additional documentation, usage docs, etc.:

- [Usage]: When configuring a private image registry that requires mTLS authentication, KubeKey will now automatically generate and use a dedicated client certificate for communication.

@kubesphere-prow kubesphere-prow Bot added release-note kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 2, 2026
@kubesphere-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: redscholar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubesphere-prow kubesphere-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the generation and usage of dedicated client certificates (image-registry-client.crt and image-registry-client.key) for the image registry, replacing the previous use of the server-side certificates for client authentication. This includes updating the certificate generation tasks, default configuration paths, precheck tasks, and documentation. There are no review comments, so no feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@redscholar redscholar force-pushed the image_registry_client_certs branch 2 times, most recently from 052467d to a90b866 Compare June 2, 2026 08:38
Signed-off-by: redscholar <blacktiledhouse@gmail.com>
@redscholar redscholar force-pushed the image_registry_client_certs branch from a90b866 to 7041d8f Compare June 2, 2026 09:25
@kubesphere-prow kubesphere-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 2, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

@redscholar redscholar added the lgtm Indicates that a PR is ready to be merged. label Jun 2, 2026
@ks-ci-bot ks-ci-bot merged commit 5c20970 into kubesphere:main Jun 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. release-note size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants