add version and headers fields to HTTPChk - #214
Merged
Conversation
m-terra
approved these changes
Aug 6, 2026
m-terra
left a comment
Collaborator
There was a problem hiding this comment.
LGTM - thank you very much for your contribution
xosk31
approved these changes
Aug 6, 2026
xosk31
approved these changes
Aug 6, 2026
xosk31
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the contribution, much appreciated!
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds support for custom HTTP versions and HTTP headers in the
HTTPChkconfiguration for backends and listens.Motivation
Currently,
spec.httpchkonly supportsmethodandurifields, which limits the ability to construct customhttp-check senddirectives (e.g.,option httpchk GET / HTTP/1.0\r\nUser-Agent:...).By adding the optional
versionandheadersfields toHTTPChk, users can now set custom HTTP versions (such asHTTP/1.0) and append arbitrary headers (like customUser-Agents) to their health check requests.Changes
versionandheadersfields to theHTTPChkstruct inapis/config/v1alpha1/common_types.go.HasCustomSendLine()andCustomSendHTTPCheck()helper methods to build the appropriatehttp-check senddirective whenversionorheadersare set.AddToParser()inbackend_types.goto inject the customhttp-checkline into the HAProxy configuration.backend_types_test.goto verify customhttp-check sendgeneration and validation logic.Checklist