kyma-project / telemetry-manager

Manager for the Kyma telemetry module
https://kyma-project.io/#/telemetry-manager/user/README
Apache License 2.0
5 stars 23 forks source link

Notify by k8s event if referenced secret does not exist #561

Open skhalash opened 2 years ago

skhalash commented 2 years ago

Description

If a logpipeline, which references a non-existing secret, is deployed to a cluster, the following things should happen:

  1. An event should be generated, which indicates that referenced secret does not exist. The behavior should be similar to deploying a pod, which references a non-existing secret:
    Events:
    Type     Reason       Age                    From     Message
    ----     ------       ----                   ----     -------
    Warning  FailedMount  11m (x119 over 3h57m)  kubelet  MountVolume.SetUp failed for volume "dummy" : secret "dummy" not found
  2. The error should be logged.
  3. The controller should keep reconciling the logpipeline until the secret is created.
  4. The logpipeline should be in the Pending state until the secret is created.

Reasons

Generating an event makes it possible for a Kyma user to troubleshoot the problem by using kubectl describe. . Attachments

https://book-v1.book.kubebuilder.io/beyond_basics/creating_events.html

a-thaler commented 2 years ago

What should happen if the secret gets deleted after the LogPipeline got established?

skhalash commented 2 years ago

@a-thaler Currently, the data from the referenced secrets is copied into a special secret owned by the operator. If a referenced secret is deleted, a copy still remains.

skhalash commented 2 years ago

Some info about btp-operator credentials rotation. Whenever automatic service binding is enabled, the controller creates new bindings (derived from the original bindings), which creates new secrets. So existing secrets remain untouched.

ghost commented 2 years ago

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[bot] commented 2 years ago

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.