fix: propagate probe fields and emit spec.storage to varnishd (#37)#38
Merged
fix: propagate probe fields and emit spec.storage to varnishd (#37)#38
Conversation
Two v0.4.0 production bugs from #37: - Probe fields besides URL were dropped: the backend template hardcoded interval=5s timeout=2s window=5 threshold=3 regardless of spec.backends[].probe values. Under load, a healthy-but-slow backend was marked sick by the 2s timeout, which the shard director with healthy=CHOSEN turned into a 503 storm. Fixed the generator to resolve all probe fields (with the same defaults as the previous hardcoded values) and threaded them through the template. ExpectedResponse is emitted only when set. - spec.storage was persisted on the CR but never reached varnishd. The varnish container's Args had no -s flags, so varnishd fell through to the stock image default of -s malloc,100M. Production saw 352k allocation failures and a 24% hit ratio on a spec that asked for 1500M. Added storageArgs() helper emitting one -s <name>=<type>,<options> per spec.storage entry. Refs #37
Local Claude Code session directory, not relevant to the repo. Was flagged as an untracked change during every PR creation.
This was referenced Apr 18, 2026
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
Two production bugs in v0.4.0 surfaced in #37, both dropping user spec on the floor:
.urlwere ignored. The backend template hardcodedinterval=5s timeout=2s window=5 threshold=3. Prod saw healthy-but-slow Plone pods marked sick by the 2s timeout, which the shard director withhealthy=CHOSENturned into a 503 storm.spec.storagenever reached varnishd. The varnish container had no-sargs, so varnishd used the stock image default-s malloc,100M. A spec requesting 1500M ran with 100M; 352k allocation failures, 24% hit ratio.Fix
backends[].probefields (Interval, Timeout, Window, Threshold, ExpectedResponse) with the previous hardcoded values as defaults — no behaviour change for users who only set.url.expected_responseis emitted only when set.storageArgs()helper emits one-s <name>=<type>,<options>perspec.storage[]entry. Malloc → bytes. File → path,bytes. Unknown types are skipped (webhook already rejects them).Tests
TestGenerate_ProbeFields_PropagatedToPerPodBackends— explicit spec values reach every per-pod backend.TestGenerate_ProbeDefaults_AppliedWhenFieldsUnset— defaults match previously hardcoded values.TestStorageArgs_{Malloc,File,Multiple,Empty}— the four interesting shapes.Full
go test ./...green.Test plan (reviewer)
ghcr.io/bluedynamics/cloud-vinyl-operator:0.4.1in a test cluster.spec.storage: [{name: s0, type: malloc, size: 1500M}]andspec.backends[0].probe: {timeout: 5s, window: 10, threshold: 8}.kubectl execinto the varnish pod: confirmvarnishadm vcl.show -vshows the configured probe values andps -f 1shows-s s0=malloc,1500000000.Refs #37