Skip to content

Add check port support - #231

Open
kenichi-mashiyama wants to merge 1 commit into
six-group:mainfrom
kenichi-mashiyama:add-check-port-support
Open

Add check port support#231
kenichi-mashiyama wants to merge 1 commit into
six-group:mainfrom
kenichi-mashiyama:add-check-port-support

Conversation

@kenichi-mashiyama

Copy link
Copy Markdown
Contributor

Summary

This PR adds support for configuring a dedicated health check port (check port <number>) for servers across backends and listens.

Motivation

Currently, when health checks are enabled, HAProxy Operator defaults to using the same port as the server's traffic port for health checks. However, some applications expose a separate, dedicated port for health checks or metrics (e.g., application traffic on port 8080, but health checks on port 80). By adding the port field to the Check struct, users can now explicitly specify a different port for health checks directly through the CRDs.

Changes

  • Added the Port (*int64) field with validation (min: 1, max: 65535) to the Check struct in apis/config/v1alpha1/common_types.go.
  • Updated the Model() methods for Server and ServerTemplate to map this new field to the native HAProxy model (model.HealthCheckPort).
  • Added a unit test in apis/config/v1alpha1/backend_types_test.go to verify the correct generation of the check port <number> configuration on the server line.
  • Regenerated CRDs, DeepCopy methods, and API documentation to reflect the schema updates.

Checklist

  • Code changes implemented
  • Unit tests added/updated
  • Generated CRDs and API docs updated

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.

1 participant