You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: Do not cache native resources created without CommonLabels (#1818)
* fix: Limit cache for k8s native resources
* feat: Disable caching of ConfigMaps and Secrets
feat: Toggle caching of ConfigMaps and Secrets with CommonLabels
* chore: Move sharding log out of main (cyclomatic lint)
* chore: Update commments
* Refactor: Re-use new util func to create cacheLabelConfig for default setups
* fix: Avoid labels.Everything returned from getLabelSelectors
* feat: Add a way to disable the cache limitations for backwards compatibility
* chore: Make cache improvements opt-in
* chore: Update env var name and "watchLabeledReferencesOnly" description in Helm values
* refactor: switch to `ENFORCE_CACHE_LABELS` env var
---------
Co-authored-by: Dominik Süß <[email protected]>
Copy file name to clipboardexpand all lines: deploy/helm/grafana-operator/README.md
+1
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,7 @@ It's easier to just manage this configuration outside of the operator.
68
68
| dashboard.annotations | object |`{}`| Annotations to add to the Grafana dashboard ConfigMap |
69
69
| dashboard.enabled | bool |`false`| Whether to create a ConfigMap containing a dashboard monitoring the operator metrics. Consider enabling this if you are enabling the ServiceMonitor. Optionally, a GrafanaDashboard CR can be manually created pointing to the Grafana.com dashboard ID 22785 https://grafana.com/grafana/dashboards/22785-grafana-operator/ The Grafana.com dashboard is maintained by the community and does not necessarily match the JSON definition in this repository. |
70
70
| dashboard.labels | object |`{}`| Labels to add to the Grafana dashboard ConfigMap |
71
+
| enforceCacheLabels | string |`"off"`| Sets the `ENFORCE_CACHE_LABELS` environment variable, Enables the enforcment of cache labels, reducing memory usage significantly. Valid values are "off","safe" and "all". When using `safe` mode, ConfigMaps and Secrets are excluded from caching. When using `all` mode, ConfigMaps and Secrets are cached and require the `app.kubernetes.io/managed-by: grafana-operator` label. |
71
72
| env | list |`[]`| Additional environment variables |
72
73
| extraObjects | list |`[]`| Array of extra K8s objects to deploy |
setupLog.Info(fmt.Sprintf("sharding is enabled via %s=%s. Beware: Always label Grafana CRs before enabling to ensure labels are inherited. Existing Secrets/ConfigMaps referenced in CRs also need to be labeled to continue working.", watchLabelSelectorsEnvVar, watchLabelSelectors))
setupLog.Info("label restrictions for cached resources are active", "level", enforceCacheLabelsLevel)
155
+
case"off", "":
156
+
default:
157
+
setupLog.Error(fmt.Errorf("invalid value %s for %s", enforceCacheLabelsLevel, enforceCacheLabelsEnvVar), "falling back to disabling cache enforcement")
setupLog.Info(fmt.Sprintf("sharding is enabled via %s=%s. Beware: Always label Grafana CRs before enabling to ensure labels are inherited. Existing Secrets/ConfigMaps referenced in CRs also need to be labeled to continue working.", watchLabelSelectorsEnvVar, watchLabelSelectors))
0 commit comments