-
Notifications
You must be signed in to change notification settings - Fork 149
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
Annotations cannot be removed by operator #1171
Comments
Based on quick research there is only 1 option - use 3-way merge. In this case, operator must keep last applied metadata into the special annotation. And perform decision to remove annotation based on previous state. Operator cannot remove any annotations manually assigned. Since it breaks logic for other controllers. Such as For instance, |
I find out that But in terms of Kubernetes it has major down-sides and it makes changes hard to track and actually use. The biggest concern for that is In addition, many deployment tools, such as It leads to the following upcoming changes:
FYI @Haleygo Related Kubernetes issue: |
Previously, labels and annotations metadata was inherited from base CRD object to the all children objects created operator. Such as Deployment, ServiceAccount and etc. This commit reworks `labels` and `annotations`. Since v0.52.0 release operator will no longer use add base CRD object metadata to the created objects. It will use `managedMetadata` as the source of it. It has the following benefits: * it's no longer needed to filter-out labels and annotations to be compatible with application deployment tools. Such as helm or argocd * changes to `managedMetadata` will trigger `generation` field change for the CRD and it'll possible to properly trigger update status. * it'd be possible to remove annotations managed by operator and preserve 3rd party annotations. Related issue: #1171
The issue was fixed at v0.51.1 release |
Currently, operator merges annotations exists at managed objects with annotations defined at
CRDs
definition.Consider the following example:
Created deployment has annotation:
Due to labels.Merge logic at
reconcile
package: https://github.com/VictoriaMetrics/operator/blob/master/internal/controller/operator/factory/reconcile/deploy.go#L51Operator will always keep
some-key
annotations.Main reason behind that is preserving annotations added by 3rd party components, such as mutation webhooks.
Possible solutions:
CRD
as source of truth.The text was updated successfully, but these errors were encountered: