Files
seaweedfs/seaweed-block/examples/kubernetes/basic-app/README.md
T
Ping Qiu 5c4f995c55 v0.2 alpha: Day-1 activation and first-volume loop (#48)
Package the Kubernetes alpha into a script-based Day-1 activation loop: activate the stack, create the first PVC-backed volume, verify writer/reader data, collect product-owned observation evidence, render a local read-only report, and clean up.

Includes multi-node-safe activation defaults, first-volume example automation, read-only ops report output, README/quickstart/release note updates, and review-driven hardening for fail-fast configuration, promotion evidence, inventory fail-closed behavior, and test guards.

Validated by Day-1 activation run 20260517-205252-04e9 and read-only report run 20260517-212358-bfba. Local targeted tests passed.
2026-05-18 16:43:35 -07:00

88 lines
2.0 KiB
Markdown

# Basic Kubernetes App Example
This example shows the smallest application-facing shape:
```text
StorageClass -> PVC -> writer pod -> reader pod
```
It assumes the seaweed-block alpha stack is already installed in the cluster.
For the full install-and-demo flow, run:
```bash
bash scripts/run-k8s-demo.sh "$PWD"
```
To install the alpha stack and keep it running for this example:
```bash
bash scripts/activate-k8s-alpha.sh "$PWD"
```
## Apply
```bash
kubectl apply -f storageclass-pvc.yaml
kubectl apply -f writer-pod.yaml
```
Wait for the writer:
```bash
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded pod/sw-block-example-writer --timeout=240s
kubectl logs sw-block-example-writer
```
Expected:
```text
/data/demo.bin: OK
```
Delete the writer pod but keep the PVC:
```bash
kubectl delete pod sw-block-example-writer
```
Start the reader pod against the same PVC:
```bash
kubectl apply -f reader-pod.yaml
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded pod/sw-block-example-reader --timeout=240s
kubectl logs sw-block-example-reader
```
Expected:
```text
/data/demo.bin: OK
```
The second pod reading the checksum proves the data came from the PVC, not from
the first pod's container filesystem.
## Cleanup
```bash
kubectl delete pod sw-block-example-reader --ignore-not-found=true
kubectl delete pod sw-block-example-writer --ignore-not-found=true
kubectl delete pvc sw-block-example-pvc --ignore-not-found=true
kubectl delete storageclass sw-block-example --ignore-not-found=true
```
The product-owned launcher should remove PVC-owned generated blockvolume
Deployments after the PVC is deleted. If you are using this example manually,
inspect generated workloads before uninstall:
```bash
kubectl get deploy -A -l app=sw-blockvolume
```
## Alpha Notes
- `ReadWriteOnce` is the intended mode.
- The example uses a tiny `1Mi` PVC because this is a functional smoke, not a
capacity or performance benchmark.
- Current alpha storage is not production durable.