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

Add Helm annotation to CRDs to prevent accidental deletion. #7811

Merged
merged 2 commits into from
May 15, 2024

Conversation

naemono
Copy link
Contributor

@naemono naemono commented May 14, 2024

What are these changes?

resolves #5117
related #7754

  • This adds an annotation to existing CRDs installed via Helm helm.sh/resource-policy: keep which allows the CRDs to persist even after a Helm deletion/uninstall happens.

Testing

Tested uninstalling the Helm chart, which allows the CRDs to persist:

❯ helm uninstall elastic-operator -n elastic-system
These resources were kept due to the resource policy:
[CustomResourceDefinition] kibanas.kibana.k8s.elastic.co
[CustomResourceDefinition] logstashes.logstash.k8s.elastic.co
[CustomResourceDefinition] stackconfigpolicies.stackconfigpolicy.k8s.elastic.co
[CustomResourceDefinition] agents.agent.k8s.elastic.co
[CustomResourceDefinition] apmservers.apm.k8s.elastic.co
[CustomResourceDefinition] beats.beat.k8s.elastic.co
[CustomResourceDefinition] elasticmapsservers.maps.k8s.elastic.co
[CustomResourceDefinition] elasticsearchautoscalers.autoscaling.k8s.elastic.co
[CustomResourceDefinition] elasticsearches.elasticsearch.k8s.elastic.co
[CustomResourceDefinition] enterprisesearches.enterprisesearch.k8s.elastic.co

Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
@naemono naemono added >enhancement Enhancement of existing functionality v2.14.0 labels May 14, 2024
Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
Copy link
Collaborator

@pebrc pebrc left a comment

Choose a reason for hiding this comment

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

Simple and effective 🎉

@naemono naemono merged commit 54dbed4 into elastic:main May 15, 2024
5 checks passed
@naemono naemono deleted the add-helm-keep-annotation branch May 15, 2024 14:26
@naemono
Copy link
Contributor Author

naemono commented May 16, 2024

💚 All backports created successfully

Status Branch Result
2.13

Questions ?

Please refer to the Backport tool documentation

naemono added a commit to naemono/cloud-on-k8s that referenced this pull request May 16, 2024
…7811)

* Add helm annotation to CRDs to prevent accidental deletion.
* Add annotation to template as well.
---------
Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
(cherry picked from commit 54dbed4)
Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
naemono added a commit that referenced this pull request May 16, 2024
…7815)

* Add helm annotation to CRDs to prevent accidental deletion.
* Add annotation to template as well.
---------
(cherry picked from commit 54dbed4)
Signed-off-by: Michael Montgomery <mmontg1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality v2.13.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent unintentional removal of all clusters if CRD is removed
3 participants