Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a separate controller for Certificate management #1479

Open
skhalash opened this issue Sep 26, 2024 · 1 comment
Open

Introduce a separate controller for Certificate management #1479

skhalash opened this issue Sep 26, 2024 · 1 comment
Labels
area/manager Manager or module changes

Comments

@skhalash
Copy link
Collaborator

skhalash commented Sep 26, 2024

Description

Currently, certificate management is fragmented across multiple areas. The process can be described as follows:

  • In the main function, a CA certificate is initialized and stored in a newly created secret. If the secret already exists, the system checks whether the certificate is still valid, ensuring it hasn't expired and that the key meets the required length. Additionally, a server certificate is generated and signed with the CA certificate. A validating webhook configuration is created, and the CRD conversion webhook configuration is patched accordingly.

  • In the telemetry reconciler, the secret is updated with telemetry as the owner. The validating webhook configuration is invalidated when necessary. If telemetry is about to be deleted (guarded by a finalizer), the validating webhook configuration is cleaned up.

To summarize, the following issues exist:

  • The workflow is fragmented across multiple areas, making it difficult to maintain a clear overview.
  • Certificate management is unnecessarily coupled to the Telemetry CR lifecycle, even though the two are unrelated.

As an alternative, it is a common practice to introduce a separate controller that takes care of certificate lifetime. Here are some examples:
https://github.com/kyma-project/api-gateway/blob/main/controllers/certificate/certificate_controller.go
https://github.com/knative/pkg/blob/main/webhook/certificates/certificates.go

@skhalash skhalash added the area/manager Manager or module changes label Sep 26, 2024
Copy link

This issue has been automatically marked as stale due to the lack of recent activity. It will soon be closed if no further activity occurs.
Thank you for your contributions.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 26, 2024
@skhalash skhalash removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/manager Manager or module changes
Projects
None yet
Development

No branches or pull requests

1 participant