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

[Telemetry Operator] Keep webhook CA bundle stable over Pod restart and webhook modifications #16626

Closed
chrkl opened this issue Jan 19, 2023 · 2 comments
Assignees
Labels
area/telemetry Issues or PRs related to the telemetry module
Milestone

Comments

@chrkl
Copy link
Contributor

chrkl commented Jan 19, 2023

Description
Dependent on kyma-project/telemetry-manager#36

The telemetry-operator generates a new self-signed certificate for the webhook server in the init phase and patches the ValidatingWebhookConfiguration with the new CA bundle on every Pod start. This might cause problems during a rolling restart of the operator pod where the ValidatingWebhookConfiguration is already updated with a new CA bundle, but requests are still served by the old Pod.

The init logic should be turned into a proper reconcilation of the webhook using a long-living CA certificate stored in a dedicated secret.

Criteria

  • The telemetry-operator reconciles a secret containing a long-living CA bundle
  • The operator will refresh the CA bundle if it is about to expire
  • The operator will reconcile the webhook by leveraging the ca-bundle from the secret, with that it will be generated initially but also if it gets deleted/edited for any reasons
  • The operator will generate a server-side certificate
  • The operator deletes the webhook on deletion of the module CR
  • webhook is removed from kustomize resources
@chrkl chrkl added the area/logging Issues or PRs related to the logging module (deprecated) label Jan 19, 2023
@a-thaler a-thaler changed the title [Telemetry Operator] Keep webhook CA bundle over Pod restart [Telemetry Operator] Keep webhook CA bundle stable over Pod restart and webhook modifications Mar 6, 2023
@a-thaler a-thaler added area/telemetry Issues or PRs related to the telemetry module and removed area/logging Issues or PRs related to the logging module (deprecated) labels Mar 6, 2023
@chrkl
Copy link
Contributor Author

chrkl commented May 26, 2023

PR kyma-project/telemetry-manager#173 introduced the following changes:

  • A long-living CA bundle for the webhook is used (stored in a secret and rotated yearly)
  • Short-living server certificates are signed with the CA and used for the webhook server
  • The webhook configuration and CA bundle are owed by the telemetry CR and deleted when the module is deleted
  • The webhook configuration was never installed by kustomize, no changes needed here

@chrkl
Copy link
Contributor Author

chrkl commented Jun 5, 2023

PR kyma-project/telemetry-manager#192 changed the behaviour to rotate the webhook server certificate only when it is about to expire. Also re-creating the certificate in the case of a missing module CR is ensured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/telemetry Issues or PRs related to the telemetry module
Projects
None yet
Development

No branches or pull requests

3 participants