Overview
A tiny HTTP server built into Expanse that answers every request with body. It needs no package, starts in well under a second, and is the workload Expanse's scheduler and lifecycle tests use. It is the type Getting started deploys first.
- Shape
- Stateless replicas
- Reached at
- Node port, or a VIP
- Node package
- None
Built into Expanse: it runs on any node with no extra package.
Example
echo.yaml
apiVersion: expanse.io/v1 kind: Block metadata: name: echo namespace: default spec: type: util/echo replicas: 1 resources: requests: cpu: 100m memory: 64Mi config: port: 18080 body: "hello from expanse"
$ expanse ctl block apply -f echo.yaml --dry-run # validate only $ expanse ctl block apply -f echo.yaml
Configuration
Keys go under spec.config and are checked against the type's JSON Schema when the block is applied. A default is what the block uses when the key is unset.
| Key | Default | Meaning |
|---|---|---|
body | empty | HTTP response body served on every path. |
port | a random free port | TCP port the server listens on. 0 or unset picks a free port, so several replicas can share a node. |
Using it
$ expanse ctl block apply -f echo.yaml $ curl http://<node address>:18080/ hello from expanse
/healthz answers ok, for an HTTP readiness probe.
When a node fails
Nothing is stored. A failed node's replica is placed again elsewhere after the unreachable grace (30 s).
Limits
- A test workload.
Source
- nix/blocks/util/echo: the type's identity and JSON Schema.