Kubernetes operator · Go · MIT
Is your live stream actually live?
Declare a stream as a StreamProbe. The operator checks, on an interval, that the playlist answers, that its live edge moves, and that the origin serves the newest segment, and writes the answer where your platform already looks: the resource's status, Kubernetes events, and Prometheus.
At a glance
$ kubectl get streamprobes
NAME READY REASON EDGE ADVANCED AGE
unified-live-demo True Live 935119251 2s 3h
channel-2 False Stale 918233 6m 3h
origin-eu False SegmentFailed 4410291 1s 3h
Why an HTTP health check is not enough
A live stream fails in ways a 200 does not show. The origin answers, the playlist is valid, and nobody is watching anything.
-
The playlist stops moving
The encoder died; the origin keeps serving the last playlist it had. Every request is a 200. streamprobe watches the live edge and calls it
Staleafter three target durations. -
The segments are not there
The playlist moves, but the segments it lists return 404 or time out: players stall. streamprobe asks for the live-edge segment on every check:
SegmentFailed. -
The stream ended
An
#EXT-X-ENDLISTon a channel that should be live, or a VOD URL where a live one was meant:Ended, not a silent green.
The verdict
Each check sets the Ready condition. The reasons are tried in this order; the first that applies wins.
| Reason | Ready | When |
|---|---|---|
FetchFailed | False | the playlist could not be fetched or read, or lists no segment |
Ended | False | the playlist has #EXT-X-ENDLIST |
Stale | False | the live edge has not moved for longer than staleAfter (default: three target durations) |
SegmentFailed | False | the live-edge segment did not answer 2xx |
Live | True | otherwise |
An event is recorded when the reason changes, not on every check, and five Prometheus metrics per stream follow it: see the reference.
Get started
You need Go 1.26 or later, kubectl, and a cluster: kind on your laptop is enough.
git clone https://github.com/Allan-Nava/streamprobe-operator
cd streamprobe-operator
make install # the CRD, into the cluster of your current context
make run # the controller, on your machine, against that cluster
In a second terminal, watch a public live demo stream:
kubectl apply -f - <<'EOF'
apiVersion: streaming.allan-nava.github.io/v1alpha1
kind: StreamProbe
metadata:
name: unified-live-demo
spec:
url: https://demo.unified-streaming.com/k8s/live/stable/live.isml/.m3u8
interval: 30s
EOF
kubectl get sp -w
Then kubectl describe sp unified-live-demo shows the status and the events. To run it in the cluster instead, make deploy installs the published image, ghcr.io/allan-nava/streamprobe-operator (linux/amd64 and linux/arm64); the reference has the details. A Helm chart is planned (v0.2.0).
Built to learn Kubernetes from the inside
streamprobe is also a learning project: an operator written from scratch with kubebuilder and controller-runtime, by someone who ran live video on Nomad for years. How it works explains every piece, what an operator is, the reconcile loop, why the controller ignores its own writes, how it is tested against a real API server, and how each idea maps to Nomad.