BUG/MINOR: haproxy: gate PSP Role and RoleBinding on k8s < 1.25, update appVersion to 3.4.4 - #385
Merged
Merged
Conversation
The PodSecurityPolicy template is gated behind a semverCompare "<1.25.0-0" check, but the Role and RoleBinding that grant "use" on it were only gated on rbac.create and podSecurityPolicy.enabled. On Kubernetes 1.25 and newer the chart therefore rendered a Role referencing the policy/podsecuritypolicies resource, plus its RoleBinding, while the PodSecurityPolicy itself was correctly omitted. RBAC rules are not validated against discovery, so these objects applied without error and were merely dead configuration, but they referenced an API removed in 1.25 and made podSecurityPolicy.enabled=true look effective on clusters where it can no longer do anything. Add the same version gate to both templates so all three objects appear and disappear together. This is the same fix already applied to the kubernetes-ingress chart in commit 2018c28. Verified by rendering across the chart's full supported range with --kube-version: PodSecurityPolicy, Role and RoleBinding are all present on 1.17 through 1.24, and all absent on 1.25, 1.26, 1.37 and provider-suffixed versions such as v1.37.1-gke.1000 and 1.37.0+k3s1. Signed-off-by: Dinko Korunic <dkorunic@haproxy.com>
Move the chart to the HAProxy 3.4.4 base image. The values.yaml image.tag is empty by default and falls back to the chart appVersion, so bumping appVersion is enough to move the rendered image; the artifacthub.io/images annotation is updated to match. Verified that docker.io/haproxytech/haproxy-alpine:3.4.4 exists upstream (amd64 and arm64), that Deployment and DaemonSet both render haproxy-alpine:3.4.4 by default, and that an explicit image.tag override still takes precedence. Signed-off-by: Dinko Korunic <dkorunic@haproxy.com>
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.
Same defect as #384, found while reviewing all three charts for Kubernetes 1.37 compatibility.
Problem
podsecuritypolicy.yaml:17is gated behindsemverCompare "<1.25.0-0", butrole.yaml:17androlebinding.yaml:17— which grantuseon that PodSecurityPolicy — were gated only onrbac.createandpodSecurityPolicy.enabled.On Kubernetes 1.25+ with
podSecurityPolicy.enabled=true, the chart rendered aRolegrantinguseonpolicy/podsecuritypolicies(API removed in 1.25) plus itsRoleBinding, while thePodSecurityPolicyitself was correctly omitted.RBAC rules are not validated against discovery, so these applied without error — dead configuration. The practical harm is that
podSecurityPolicy.enabled=truelooked effective on clusters where it can no longer do anything.Fix
Add the same version gate to both templates so all three objects appear and disappear as a unit.
Verification
Rendered across the chart’s full
>=1.17support range:1.17.01.19.01.24.91.25.01.26.01.37.0v1.37.1-gke.10001.37.0+k3s1./test/local-test.sh haproxy— 38 passed, 0 failed./test/ct-test.sh lint haproxy— ✔︎ passedChart version bumped
1.30.1→1.30.2(patch; bugfix), with theartifacthub.io/changeslist replaced by this release’s entry.Notes
Role/RoleBindingremoved on nexthelm upgrade. They were inert, but it is a resource deletion worth a changelog line.podsecuritypolicy.yaml:22branches on.Capabilities.APIVersions.Has "policy/v1/PodSecurityPolicy", but PSP never graduated topolicy/v1— that branch is permanently false and falls through topolicy/v1beta1. Harmless, since the file is gated off above 1.25.Second commit: appVersion 3.4.3 → 3.4.4
Moves the chart to the HAProxy 3.4.4 base image.
values.yamlhasimage.tag: "", which falls back to the chartappVersion, so the appVersion bump is what moves the rendered image; theartifacthub.io/imagesannotation is updated to match.Verified:
docker.io/haproxytech/haproxy-alpine:3.4.4exists upstream (amd64 + arm64, pushed 2026-09-03)haproxy-alpine:3.4.4by default--set image.tag=3.4.2override still takes precedence3.4.3references remain anywhere in the chartlocal-test.sh haproxy38/38 passed,ct-test.sh lint haproxypassedBoth changes ship under the single
1.30.2bump since neither has been released yet.