-
Notifications
You must be signed in to change notification settings - Fork 196
Add health endpoint with readiness and liveness probes #416
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
Merged
ChristianGeie
merged 56 commits into
master
from
Add-Health-Endpoint-with-Readiness-and-Liveness-Probes
Oct 28, 2025
Merged
Add health endpoint with readiness and liveness probes #416
ChristianGeie
merged 56 commits into
master
from
Add-Health-Endpoint-with-Readiness-and-Liveness-Probes
Oct 28, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add mark_ready() after initial write to container filesystem
* Sending URL request need a log Info event: Requiring debug log level to see url request is either unhelpful or too noisy. Also mirrors script running log event. * When logging of url request "None" was reported if defaulting to GET method. * Useful to see payload in event og POST. * Removal of ellipsis in config load. * A missing, non-mandatory, option (folder annotation) shouldn't result in a warning.
Bumps [requests](https://github.com/psf/requests) from 2.32.3 to 2.32.4. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](psf/requests@v2.32.3...v2.32.4) --- updated-dependencies: - dependency-name: requests dependency-version: 2.32.4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [kubernetes](https://github.com/kubernetes-client/python) from 32.0.1 to 33.1.0. - [Release notes](https://github.com/kubernetes-client/python/releases) - [Changelog](https://github.com/kubernetes-client/python/blob/v33.1.0/CHANGELOG.md) - [Commits](kubernetes-client/python@v32.0.1...v33.1.0) --- updated-dependencies: - dependency-name: kubernetes dependency-version: 33.1.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [logfmter](https://github.com/josheppinette/python-logfmter) from 0.0.9 to 0.0.10. - [Release notes](https://github.com/josheppinette/python-logfmter/releases) - [Changelog](https://github.com/josheppinette/python-logfmter/blob/main/HISTORY.md) - [Commits](josheppinette/python-logfmter@v0.0.9...v0.0.10) --- updated-dependencies: - dependency-name: logfmter dependency-version: 0.0.10 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]>
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](actions/download-artifact@v4...v5) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
especially for SSLCertVerificationError
to avoid returning "none" which would lead to an AttributeError in the caller code. add exception handling for SSLError and RetryError add debug log message for dummy response
in _get_file_data_and_name() to avoid AttributeError
This reverts commit d1dc57c.
This reverts commit 12eaa68.
This reverts commit 7f0399e.
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]>
…al None responses
…zation and add a check for 5xx error handling
… instead of existence
…zation with more detailed error messages and add a check for empty 500.txt files
This was
linked to
issues
Oct 28, 2025
Closed
The Kubernetes client configuration was not being reliably initialized in the forked processes used by the WATCH and SLEEP methods. This was due to a call to a non-existent function `_ensure_kube_config_in_child` which was left over from a previous refactoring. This change replaces the broken call with a call to the correct `_initialize_kubeclient_configuration` function at the start of the `list_resources` and `_watch_resource_iterator` functions. This ensures that a valid Kubernetes client configuration is loaded in every process, resolving potential connectivity issues with the API server. The unused and broken helper function `_init_kube_in_child_if_needed` has been removed.
This commit enhances the integration test suite to verify that the Kubernetes client is correctly configured in both WATCH and SLEEP modes.
- A new 'sidecar-sleep' pod is added to the test resources, configured to run in SLEEP mode.
- The 'build_and_test' workflow is updated to include this new pod in the test run.
- A new verification step, "Verify K8s Config Loading", is added. This step dynamically retrieves the ClusterIP of the Kubernetes API service and checks the logs of both the WATCH mode pod ('sidecar') and the SLEEP mode pod ('sidecar-sleep') to ensure they connect to the correct API server address.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
github_actions
Pull requests that update Github_actions code
python
Pull requests that update Python code
test
new or better tests
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a comprehensive health check endpoint (/healthz) to significantly improve the robustness and reliability of the sidecar when running in a Kubernetes environment. It allows for proper readiness and liveness checks, enabling better lifecycle management and self-healing capabilities.
Key Features
New /healthz Endpoint: A new HTTP endpoint is available on port 8080 (configurable via the HEALTH_PORT environment variable)
Readiness Probe:
Liveness Probe:
The probe continuously monitors the sidecar's health by checking two critical conditions:
If any check fails, the probe fails, signaling Kubernetes to restart the container
Enhancements
Testing
The CI pipeline has been enhanced with new tests to validate this functionality:
This feature makes the sidecar more production-ready and easier to operate reliably within Kubernetes.