Skip to content

Add a health check with last time of sync - #204

Merged
linki merged 4 commits into
masterfrom
healthcheck
Mar 2, 2020
Merged

Add a health check with last time of sync#204
linki merged 4 commits into
masterfrom
healthcheck

Conversation

@linki

@linki linki commented Feb 26, 2020

Copy link
Copy Markdown
Member

This adds an extensible health check endpoint as well as an initial check for the last sync time.

The output can be seen at http://127.0.0.1:7979/healthz?full=1.

This particular check starts out unhealthy and switches to healthy for as long as the last sync interval isn't missed for too long (this code sets it to two intervals).

This can be used

  • in a readinessProbe to ensure the initial sync succeeds, as well as
  • in a livenessProbe to restart stackset-controller in case it gets stuck

@coveralls

coveralls commented Feb 26, 2020

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 1480

  • 1 of 12 (8.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.3%) to 69.17%

Changes Missing Coverage Covered Lines Changed/Added Lines %
controller/stackset.go 1 12 8.33%
Totals Coverage Status
Change from base Build 1464: -0.3%
Covered Lines: 1575
Relevant Lines: 2277

💛 - Coveralls

@aermakov-zalando

Copy link
Copy Markdown
Contributor

It'll still be healthy before the first Run starts, might want to add a dummy failed check when registering.

@linki

linki commented Feb 26, 2020

Copy link
Copy Markdown
Member Author

I moved registration of /healthz to after startWatch() is called. This should avoid any false positives during initial bootstrap.

@aermakov-zalando

Copy link
Copy Markdown
Contributor

Could you rebase on master? I've fixed the e2e deployment.

@aermakov-zalando

Copy link
Copy Markdown
Contributor

Otherwise LGTM.

@linki

linki commented Mar 2, 2020

Copy link
Copy Markdown
Member Author

👍

1 similar comment
@njuettner

Copy link
Copy Markdown
Contributor

👍

@linki
linki merged commit bf0cef5 into master Mar 2, 2020
@linki
linki deleted the healthcheck branch March 2, 2020 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants