1
0
mirror of https://github.com/rancher/norman.git synced 2025-04-27 19:15:07 +00:00
Commit Graph

52 Commits

Author SHA1 Message Date
Ricardo Weir
e7b7c9062f Added logs to cluster extraction 2023-03-24 13:12:14 -07:00
Steffan Tucker
1e41884a06
Fix golangci-lint issues
As part of updating dapper files, golangci-lint was set to be used. This
caused a lot of lint issues to crop up, which this fixes.
2022-07-26 10:40:30 -06:00
Ricardo Weir
20335edec8 Remove controller metrics
Norman metrics' labels have too high of a cardinality as they
include object key as a label. This is a problem because metrics
produces a data row for every combination of labels. This can
have a large impact on performance and is cautioned against in
the prometheus docs. Norman now uses lasso which has metrics with
matching functionality apart from the object key, so norman
metrics will be removed in favor of lasso metrics.
2022-04-27 11:45:54 -07:00
Darren Shepherd
8933f573f8 Don't filter out nil objects 2020-08-26 21:25:00 -07:00
Darren Shepherd
d8c3e21805 Ensure controller is scoped to namespace 2020-08-26 15:33:30 -07:00
Darren Shepherd
4b0a7e6b91 Rebase on lasso 2020-05-16 21:59:53 -07:00
Sebastiaan van Steenis
5c74e1ee1e Move debug log to trace 2020-03-11 20:37:25 -07:00
Dan Ramich
e40cd8f347 Update cluster_check to use interface if available
Problem:
cluster_check relies on reflect which is slow and causes a large
performance hit which is especially noticable on restart

Solution:
Add a new interface ObjectClusterName that objects can implement so
reflect isn't used for that type
2020-03-02 10:21:55 -07:00
Darren Shepherd
409c47c0cd Don't rate limit the sync of handlers 2020-02-06 22:04:22 -07:00
Darren Shepherd
202dd06a36 Add EnqueueAfter 2020-02-05 21:16:03 -07:00
Darren Shepherd
899cfdf49b Add ability to add handlers transactionally across controllers 2020-02-05 20:47:25 -07:00
Dan Ramich
c95753fa57 Update controller to allow adding handlers after controller is running 2020-01-22 15:15:39 -08:00
Darren Shepherd
3afadb987c Fix goroutine leak on failed sync() or before
A leak would occur if either a GenericController was created
and Sync() or Start() was never called or if Sync() failed.
2019-11-25 18:00:27 -07:00
dax
cbeaf3e5bf Fix error shadowing 2019-08-29 15:27:56 -07:00
Darren Shepherd
07c964e242 Move to some wrangler utils and k3s 2019-08-19 10:14:05 -07:00
Darren Shepherd
a719648e4b Fix bug that doesn't print errors 2019-02-01 15:05:55 -07:00
Darren Shepherd
f88fcd7223 Fix bug where we don't trigger handlers on second start 2018-11-26 08:43:27 -07:00
Darren Shepherd
a21f7b7e4c Fix bug in which all handlers would be trigger on incremental add 2018-11-09 10:20:45 -07:00
Darren Shepherd
77869d26b3 Handlers return object and error 2018-10-30 09:57:37 -07:00
Darren Shepherd
dcaea4c5dc All per controller threadiness 2018-10-22 10:51:15 -07:00
Darren Shepherd
373a1f9de1
Merge pull request #202 from ukinau/Add-Generic-Controller-Related-Metrics
Add Generic Controller Related Metrics
2018-10-09 19:31:52 -07:00
Yuki Nishiwaki
90a67b5678 Add Generic Controller Related Metrics
To enhance operatability for the service using norman framework,
It's better to expose internal state as detail as possible.
This is the just starting point but at least which handler is executed
often and which handler with which key's execution is often failed
metrics is very useful to spot the place operator have to dig in when
something happened.
So this commit added 2 metrics.
1: handler execution total count
2: handler execution failure total count
2018-10-05 14:36:58 +09:00
Darren Shepherd
c580ac3ab0
Merge pull request #201 from ukinau/Enable-fine-grained-control-for-controller-related-metrics
Enable fine-grained control for Controller related metrics
2018-10-04 14:18:49 -07:00
Yuki Nishiwaki
b18da6edc4 Allow to put Reason in controller.ForgetError
Norman Condition automatically generate condition information based on
the error the handler would return in Condition.Do function.
handler function usually return 2 types of error. the error can be
ignored and the error can not be ignored.
According to current implementation, Condition.Do function generate
condition with error state even if handler return error can be ignored.
The error that can be ignored should be ignored in the context of
condition as well.

So this commit introduce new field which is Reason to ForgetError so
that the developer can put special reason other than Error when
ForgetError is expected to happen by expected procedure like
provisioning and wait for something and Norman Condintion respect to
this field when try to generate condition information based on error

This solution will help us to fix this rancher bug
https://github.com/rancher/rancher/issues/15907
2018-10-03 02:44:42 +09:00
Yuki Nishiwaki
f103a35307 Enable fine-grained control for Controller related metrics 2018-09-26 11:51:51 +09:00
Alena Prokharchyk
1d3cf7aee8 Log forget error in debug 2018-08-25 15:44:50 -07:00
Bill Maxwell
de9510b940 Default to noop metric provider
With the built in prom. metrics provider, the k8s machinery doesnt
deregister metrics when controllers are removed. So over time as
things like clusters are created or removed the metrics are not
cleaned up. The metrics types for the cache and queue are also
very large. They can take ~1GB of RAM in a 100 cluster setup.

Also, Rancher is not exposing these stats so they are unobservable.
2018-07-27 12:50:44 -07:00
Darren Shepherd
88e3507f72 Change some logging to debug
# Conflicts:
#	controller/generic_controller.go
#	vendor.conf
2018-07-19 10:23:17 -07:00
Alena Prokharchyk
26d279bce1 Fixes to adapt to 1.10.5 2018-07-11 16:44:45 -07:00
Craig Jellick
388faeb89e Use logrus to log errors and panics
This changes the framework from using glog to using logrus, which is
what the rest of code uses.
2018-06-22 16:19:49 -07:00
Darren Shepherd
8d5d75c7b8 Check namespace for clusterName 2018-04-30 14:36:00 -07:00
kinarashah
93bfc4ea3a Check for cluster name in annotations 2018-04-06 10:21:13 -07:00
Darren Shepherd
50ffce9804 Add namespace indexer to controllers 2018-04-04 03:08:15 -07:00
Darren Shepherd
ff60298f31 Move ObjectClient to different package 2018-04-03 14:09:16 -07:00
Darren Shepherd
fcf2b88855 Add some debug logging to see churn 2018-03-23 09:44:24 -07:00
Darren Shepherd
b5aef8d08d Don't log conflicts as much 2018-03-22 15:55:44 -07:00
Darren Shepherd
1e9982bd45 Change NewErrors signature 2018-03-03 21:53:38 -07:00
Darren Shepherd
0f7c2968c9 Make controller and client more generic 2018-02-13 08:57:47 -07:00
Darren Shepherd
ef71925351 Update rate limit on the controller 2018-01-21 06:24:22 +00:00
Darren Shepherd
9e6ea56442 Changes to make conditions less chatty 2018-01-17 22:44:12 +00:00
Craig Jellick
905797b50f Add suport for cluster scoped controllers
Some worload controllers need to watch resoruces in the mangement plane
and react to them. But, they should only react to resources that
correspond to their cluster. This adds framework support for that.
2018-01-16 09:04:15 -07:00
Darren Shepherd
af105c2bc7 Add name to handlers 2018-01-16 05:10:36 +00:00
Craig Jellick
6e00d528c2 Do print controller name when logging error 2017-12-29 21:57:12 +00:00
Darren Shepherd
2550f12a9a Add offspring controller 2017-12-19 21:44:02 -07:00
Darren Shepherd
227e9f7ca0 Add ignorable error to bypass requeue 2017-12-16 01:30:46 -07:00
Darren Shepherd
ee148b4d18 Startup helper method 2017-11-28 18:58:49 -07:00
Darren Shepherd
247d4fe74b Fix startup issues 2017-11-28 18:25:18 -07:00
Darren Shepherd
389d27b3e5 Updates 2017-11-28 14:28:25 -07:00
Darren Shepherd
59d2d58c3e Fix code generator 2017-11-21 16:16:52 -07:00
Darren Shepherd
38c9c5c6c3 Subcontext and mapping updates 2017-11-21 15:37:22 -07:00