-
v0.1.1
StableAll checks were successfulRelease / chart-1 (push) Successful in 4sRelease / changelog (push) Successful in 3sRelease / shellcheck (push) Successful in 5sRelease / test (push) Successful in 24sRelease / ci (push) Successful in 0sRelease / plan (push) Successful in 4sRelease / image (push) Successful in 35sRelease / chart (push) Successful in 5sRelease / release (push) Successful in 1sreleased this
2026-11-13 03:54:27 +00:00 | 0 commits to main since this releaseFixed
- The
/docscaveat and the README now say what a client sees from/dropthrough the ingress: over HTTP/1.1 an empty reply, over HTTP/2 a stream reset, and in both cases no headers and no body bytes. They said a truncated body or an early close. Thebytescount and a true TCP reset hold only on a direct connection to the pod. The behaviour of/dropis unchanged.
Downloads
-
Source code (ZIP)
1 download
-
Source code (TAR.GZ)
1 download
- The
-
v0.1.0
StableAll checks were successfulRelease / chart-1 (push) Successful in 4sRelease / shellcheck (push) Successful in 9sRelease / changelog (push) Successful in 4sRelease / test (push) Successful in 22sRelease / ci (push) Successful in 0sRelease / plan (push) Successful in 4sRelease / image (push) Successful in 34sRelease / chart (push) Successful in 6sRelease / release (push) Successful in 0sreleased this
2026-11-13 03:06:46 +00:00 | 1 commits to main since this releaseAdded
- The schedule core computes outage windows from an integer-millisecond UTC instant, with the default 1 day period, 15 minute outage, 90 % availability, even placement and seed 0 giving 10 outages per period.
- The
flapserver starts from environment variables alone (FLAP_ADDR,FLAP_BASE_URL,FLAP_MAX_HANG,FLAP_MAX_HANGS,FLAP_MAX_DROP_BYTES,FLAP_LOG_LEVEL,FLAP_DRAIN_DELAY), refuses invalid values at startup and reports its version from-X main.version. - Every request writes one structured JSON access log line with method, path, sanitised query, status, response bytes, duration, outage state, failure kind and client address.
GET /healthzalways answers 200ok, andGET /readyzanswers 200okuntil shutdown begins and 503 afterwards, so both work as Kubernetes probes.- On SIGTERM the server turns readiness to 503, keeps serving for the drain delay (default 5 s), releases held requests and shuts down within 10 s.
- Scattered and grid placements draw window positions from the seeded stream, so a rerun with the same seed reproduces the same outages. Grid placement needs a period that is a multiple of the outage length and at most one outage per slot. A golden file pins the windows of 67 parameter sets and fails the tests on any drift;
go test ./internal/schedule -run Golden -updateregenerates it. - Schedule parameters (
period,outage,count,availability,seed,placement) are parsed from query values with defaults and bounds, and rejected with a distinct client-facing message when unusable. Unknown, repeated and empty parameters are errors, so a typo never falls back to a default, and theinternal/scheduleparameter table lists every parameter, default and bound. GET /inspectdescribes a schedule without triggering a failure: it always answers 200 for valid parameters, in or out of an outage, with the evaluated instant, state, next change, achieved availability, the windows overlapping the current period and ready-to-calllinksforstatus,hanganddropthat carry the same schedule parameters.format=json|html|svgforces the format; otherwise anAcceptthat rankstext/htmlaboveapplication/jsongives HTML and anything else, including*/*, gives JSON.at=<RFC 3339 or unix seconds>evaluates another instant. Absolute links useFLAP_BASE_URL, elseX-Forwarded-ProtoandX-Forwarded-Host, else the request host. HTML and SVG are placeholders until the timeline view lands./status/{code}answers any method with the chosen status (200 to 599; 1xx and other codes are refused with 400) during an outage and with 200okoutside one.retry_after=<seconds>orretry_after=remainingaddsRetry-Afterduring an outage, whereremainingis the time to the end of the outage rounded up to whole seconds and at least 1. Schedule parameters,retry_afterand the code are validated before the clock is read, so an invalid request is a 400 and never produces a failure. Every response carriesCache-Control: no-store, andX-Flap-State: up|downwhenever the schedule was consulted./hangholds the response during an outage for the shorter of the time to the outage end and the optionaldurationparameter (1 ms to 366 d), capped byFLAP_MAX_HANG, then answers 200; outside an outage it answers 200 at once. A hold ends when the client disconnects or the server shuts down. AboveFLAP_MAX_HANGSconcurrent holds,/hanganswers 429 with anX-Flap-Reasonheader instead of holding./dropresets the connection during an outage after the number of body bytes given bybytes(default 0, at mostFLAP_MAX_DROP_BYTES): it declares a longerContent-Lengththan it sends and ends the connection with a TCP reset (after a FIN, so a client never waits for the missing byte), and answers 200okoutside an outage. Invalid or over-capbytesis rejected with 400 before the connection is touched.GET /docsserves a reference page generated from the parameter tables the server validates with, so it cannot drift from behaviour: every schedule parameter with its default and bounds, the three placements, the three failure kinds and their parameters (retry_after,duration,bytes,format,at), theRetry-Afterforms, the configured hang, concurrent-hang and drop-byte limits, the/inspectJSON shape, and the caveats that/dropthrough an ingress is not a true TCP reset and that proxy timeouts can cut/hang. Itscurlexamples are run against a test server in the test suite.GET /inspect?format=html(or a browserAccept) returns a page with an inline SVG timeline of the current period, the schedule parameters, the state in words, the next change, the window table and the failure links, andformat=svgreturns the same timeline as a standalone, self-contained SVG. An outage that wraps over a period boundary is drawn as two dashed segments, a tail from the left edge and a head to the right edge. The page is server-rendered from escapedhtml/templatetemplates, with no script and no external asset.- A multi-stage
Dockerfilebuilds a static, non-rootscratchimage offlap, and thecharts/flapHelm chart deploys two replicas with a PodDisruptionBudget, node spread,/healthzand/readyzprobes, a read-only security context, apreStopsleep matching the drain delay and a TLS ingress forflap.sarak.shwhose proxy timeout is checked againstFLAP_MAX_HANG. scripts/loadtest.shruns the built binary with the chart's runtime settings under steady requests plus the maximum concurrent hangs, records idle and peak resident memory against the budget (16 MiB idle, 32 MiB loaded, measured on Linux) and exits non-zero when one is missed, andgo test ./... -run Determinismstarts two real server processes and compares their/inspect?at=bodies byte for byte, also after restarting one.docs/loadtest.mdrecords the Linux numbers measured with Apple'scontainerCLI (9.4 MiB idle, 20.4 MiB loaded, so the budget is met and Go stays) and the levers tried (GOMEMLIMIT,GOGC,FLAP_MAX_HANGS);cmd/loadtesttakes-gomemlimitand-gogcto try them.GET /serves an explorer front page with one input for every schedule parameter, generated from the parameter table, that fetches/inspectas the values change and shows the state, next change, timeline, window count, achieved availability, an inline error for rejected values and copyablestatus,hanganddroplinks. It is a single embedded page with vanilla JavaScript, no framework, no build step and no schedule logic of its own, and a content security policy limits it to its own script, style and same-origin requests.charts/flap/values-saraksh.yamlholds the saraksh deployment values with the open registry path and pull secret marked and defaulted,docs/deploy.mdis the install, DNS and TLS, rollback and what-remains runbook for the live install, andscripts/verify-deploy.shchecks a deployment read-only for/healthzwith a valid certificate chain, at least two ready replicas and identical/inspectwindows across repeated calls.- Every pull request runs gofmt,
go vet,go test -race,helm lint --strict,helm template,shellcheck scripts/*.shand the changelog check in Forgejo Actions onubuntu-latest. - Every push to
mainpublishes the imagesarak.sh/mikluko/flapasmain-<sha>-<unix time>, built with ko forlinux/amd64andlinux/arm64. A push whose newestCHANGELOG.mdentry names an untagged version also pushes the image as that version andlatest, pushes the chart tooci://sarak.sh/mikluko/charts/flapwith the sameversionandappVersion, and creates the tag and the release. The workflow logs in to the registry with an OIDC token, so no registry secret is needed. - The README now covers running the service, its configuration, the endpoints, development commands and the release process, including the secrets to set and how to rehearse a release.
- The saraksh values render an Ingress of class
traefikforflap.sarak.shwithsarak.sh/dns: "true"(external-dns creates the DNS record),cert-manager.io/cluster-issuer: letsencrypt(cert-manager issues the certificate into the TLS Secret) and TLS for the host, and leave out the ingress-nginx timeout annotations that Traefik ignores.docs/deploy.mddescribes the cluster's ingress, DNS and certificate conventions, drops the manual DNS and TLS steps, and says where the proxy timeout for held/hangresponses lives on Traefik, andscripts/check-chart.shasserts the rendered Ingress.
Downloads
-
Source code (ZIP)
1 download
-
Source code (TAR.GZ)
1 download