six-group / six-group/haproxy-operator
Proposal: Pre-validate haproxy.cfg before Secret update using a short-lived Job
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 29
- Forks
- 9
- Avg merge
- 23h 55m
- Merged PRs (30d)
- 16
Description
Hi !
To improve the safety and reliability of the Operator, I'm currently considering implementing the mechanism described below.
Would you be open to accepting a pull request for this once I have it ready?
If this approach doesn't align with the project's design direction, please feel free to reject the idea—no worries at all!
Configuration Validation Before Secret Update
Before the operator updates the runtime configuration Secret (<instance>-haproxy-config), it validates the generated haproxy.cfg using a short-lived Kubernetes Job:
-
Build the generated
haproxy.cfgand all referenced certificate/config files. -
Create a temporary validation
Secret. -
Start a short-lived
Jobusing the same image as the target HAProxy instance (spec.image, fallbackhaproxy:latest) and run:haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg
-
If validation succeeds, update the runtime configuration
Secret. -
If validation fails, do not update the runtime configuration
Secret, and set theErrorstatus on theInstanceand related configuration resources. -
Clean up temporary validation resources (
JobandSecret) automatically (via TTL) and explicitly by the operator.
Looking forward to hearing your thoughts!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the operator reconciliation path that generates haproxy.cfg and updates the runtime configuration Secret, then review how Instance and related configuration resources receive Error status. Define the validation Job and temporary Secret lifecycle, including success, failure, TTL, and explicit cleanup; done means invalid configurations leave the runtime Secret unchanged while valid ones update it safely.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100