Skip to content

haproxy: add service name override - #382

Merged
dkorunic merged 5 commits into
haproxytech:mainfrom
konstantin-kelemen:main
Sep 9, 2026
Merged

dkorunic merged 5 commits into
haproxytech:mainfrom
konstantin-kelemen:main

Conversation

@konstantin-kelemen

Copy link
Copy Markdown
Contributor

We need to have an ability to change the name of the service to have meaningful DNS records for services in the cluster.

For example, currently we can only have something like this: haproxy.haproxy.svc.cluster.local.

Instead we want to name the service differently, to have something like apps.haproxy.svc.cluster.local.

This PR adds that feature.

Signed-off-by: Konstantin Kelemen <konstantin@kel.mn>
konstantin-kelemen and others added 4 commits September 9, 2026 16:26
Signed-off-by: Konstantin Kelemen <konstantin@kel.mn>
The service.name fallback was spelled out at all four references to the
Service (service.yaml, both ingress.yaml API branches, httproute.yaml),
so any template added later would silently regress to the fullname and
the two ingress branches had to be kept in sync by hand. Move it into a
haproxy.serviceName helper alongside the existing name helpers.

Quote the rendered name as well. Kubernetes parses manifests with YAML
1.1 semantics, so a valid DNS-1035 Service name such as "on", "off",
"yes" or "no" was coerced to a boolean and the object rejected with
"cannot unmarshal !!bool into string".

Claude-Session: https://claude.ai/code/session_013MqRHADUTm6nBGw7G4WP9W
Signed-off-by: Dinko Korunic <dkorunic@haproxy.com>
The comment claimed the default was .Release.Name, but the Service is
named after haproxy.fullname, ie. "<release>-haproxy". It also used a
trailing comment where the rest of the block documents keys above them.

Add the caveat that renaming the Service of an existing release replaces
it rather than updating it in place: the ClusterIP changes and, with
type LoadBalancer, the cloud provider provisions a new load balancer
with a new external address.

Claude-Session: https://claude.ai/code/session_013MqRHADUTm6nBGw7G4WP9W
Signed-off-by: Dinko Korunic <dkorunic@haproxy.com>
Nothing under haproxy/ci/ set service.name, so the consistency between
the Service and the Ingress backend it is referenced from was never
asserted by local-test.sh or the integration-test.sh ci scenario.

httpRoute is left disabled: install_charts.sh only brings up the Gateway
API CRDs for the charts that need cloud-provider-kind, and httproute.yaml
has no .Capabilities.APIVersions gate, so enabling it here would break
ct install. That path is still rendered offline by local-test.sh.

Claude-Session: https://claude.ai/code/session_013MqRHADUTm6nBGw7G4WP9W
Signed-off-by: Dinko Korunic <dkorunic@haproxy.com>
@dkorunic
dkorunic merged commit df4d4d4 into haproxytech:main Sep 9, 2026
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.

2 participants