-
Notifications
You must be signed in to change notification settings - Fork 6.3k
feat(health): add Logstash resource customization #22028
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
feat(health): add Logstash resource customization #22028
Conversation
Signed-off-by: Francis Provencher <fprovencher@drw.com>
❗ Preview Environment undeploy from Bunnyshell failedSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #22028 +/- ##
==========================================
- Coverage 60.03% 60.01% -0.03%
==========================================
Files 344 344
Lines 57781 57787 +6
==========================================
- Hits 34689 34680 -9
- Misses 20333 20341 +8
- Partials 2759 2766 +7 ☔ View full report in Codecov by Sentry. |
@@ -0,0 +1,22 @@ | |||
local hs = {} | |||
if obj.status ~= nil then | |||
if obj.status.health ~= nil then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you consolidate in one if using and?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Signed-off-by: Francis Provencher <fprovencher@drw.com>
end | ||
|
||
hs.status = "Unknown" | ||
hs.message = "Logstash status is unknown. Ensure your ArgoCD is current and then check for/file a bug report: https://github.com/argoproj/argo-cd/issues" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually, if the resource does not have the status populated yet, the default behavior is to be progressing and waiting for the controller to populate it.
I think you could have an unknown status if obj.status.health
is of an unknown colour. Then the message can say which colour it is.
hs.status = "Progressing"
hs.message = "Waiting for Logstash"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
As per the source of Logstash, if health exist, then a colour will be defined, so I left the rest of the code as-is.
Signed-off-by: Francis Provencher <fprovencher@drw.com>
@agaudreault any remaining concerns, or good to go? |
Signed-off-by: Francis Provencher <fprovencher@drw.com> Signed-off-by: dsuhinin <suhinin.dmitriy@gmail.com>
Signed-off-by: Francis Provencher <fprovencher@drw.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Signed-off-by: Francis Provencher <fprovencher@drw.com> Signed-off-by: enneitex <etienne.divet@gmail.com>
Adding custom health check logic for logstash.k8s.elastic.co/Logstash objects.
This is based on the health output that is defined here:
https://github.com/elastic/cloud-on-k8s/blob/872ca20e68404e740c879edced3933995e202316/pkg/controller/logstash/health.go#L13
Which is called from:
https://github.com/elastic/cloud-on-k8s/blob/872ca20e68404e740c879edced3933995e202316/pkg/controller/agent/reconcile.go#L217
I didn't want to reproduce the logic from the app (which could change), which is why I kept it simple.
Checklist: