docs: Kubernetes quickstart answers the C4 cell run (#993)

Merge note (batch b1; pull_request_target spec-trace workflow has a startup_failure, so its checks run locally):
- One Test run (47164144583) succeeded (go test (linux), process-level tests (real binaries)) on the integration tree 59f6e6ec = main 3ebcac06 + #971 #985 #992 #993  in this order; these squash merges reproduce that tree, verified after the last one.
- spec-trace-check.sh and public-text-check.sh, run with main's scripts against this head and body: both exit 0.
- Docs review ACCEPT on 8e08f88a: v1.1.0 is named as affected on all three pages, no fixed tag or digest is invented, images use $TAG, and the reader is placed on another Ready node that runs the CSI node plugin.
- Independent first-time operator run of this quickstart (three-node k3s) found these documentation gaps; this change answers them. The runtime rerun waits for the release that carries the generated-pod fix.
This commit is contained in:
pingqiu-cpu authored and GitHub committed 2026-12-03 10:20:17 -08:00
1 parent 473aafc021
commit 5ee720d341
3 files changed
+128 -63

No files matched your search

+11 -9
View File
@@ -200,14 +200,17 @@ it is not the `--durable-impl` default.
## Quick start: Kubernetes (alpha)
For supported lab clusters, not production. From the repository root, with
`kubectl` and `helm` configured:
For supported lab clusters, not production. v1.1.0 is affected (its generated
blockvolume pod cannot start); use the first release with the fix, as the
[Kubernetes quickstart](docs/quickstart-kubernetes.md) says. From a checkout of
that release tag, with `kubectl` and `helm` configured, `sw-block` in `PATH`, and
the TLS Secrets created (Step 0 and Step 2 of the quickstart):
```bash
go build -o sw-block ./cmd/sw-block && export PATH="$PWD:$PATH"
TAG=<the fixed release tag>
sw-block ops generate-helm-values --out values.day1.yaml \
--image ghcr.io/seaweedfs/seaweed-block:sha-dc2972d0059b \
--csi-image ghcr.io/seaweedfs/seaweed-block-csi:sha-dc2972d0059b
--image ghcr.io/seaweedfs/seaweed-block:$TAG \
--csi-image ghcr.io/seaweedfs/seaweed-block-csi:$TAG
helm install sw-block charts/seaweed-block --namespace kube-system \
--create-namespace -f values.day1.yaml --wait --timeout 10m
SW_BLOCK_INSTALL_MODE=helm SW_BLOCK_HELM_RELEASE=sw-block \
@@ -217,10 +220,9 @@ SW_BLOCK_HELM_NAMESPACE=kube-system SW_BLOCK_HELM_VALUES_FILE=values.day1.yaml \
The last command writes a PVC from one pod and reads it from a replacement
pod; expect `first_volume_status=ok` in
`/tmp/sw-block-basic-app-*/first-volume-summary.txt`. `sha-dc2972d0059b` is
the validated tag for the v0.4 read-only status path; later paths need
matching [release images](docs/kubernetes-status.md#release-images), and
`:alpha` is for smoke tests only. Each step's output is in the [Kubernetes
`/tmp/sw-block-basic-app-*/first-volume-summary.txt`. Use the images of the
release you checked out: the chart needs flags that older images lack. `:alpha`
is for smoke tests only. Each step's output is in the [Kubernetes
quickstart](docs/quickstart-kubernetes.md). To clean up:
```bash
+7 -2
View File
@@ -140,8 +140,13 @@ These are narrow alpha claims tied to documented gates. See
## Release images
Current validated published quickstart image tag: `sha-dc2972d0059b`.
This tag covers the v0.4 read-only/status foundation path. The v0.5
Install the chart from a release tag with that release's images (`:vX.Y.Z`; see
the [Kubernetes quickstart](quickstart-kubernetes.md#step-0---get-the-repository-and-the-cli)).
v1.1.0 is affected: its generated blockvolume pod cannot start, so use the first
release with that fix; the end-to-end path is validated only there.
The chart passes flags that older images do not know: the earlier quickstart tag
`sha-dc2972d0059b` (the v0.4 read-only/status path) no longer runs with the
current chart. The v0.5
bounded lifecycle-owner path requires matching `sw-block` and `sw-block-csi`
images published from the Phase 44 release commit; do not use the older
quickstart tag to validate lifecycle-owner behavior.
+110 -52
View File
@@ -49,8 +49,7 @@ Run from a Linux host with access to your Kubernetes cluster:
- `helm` installed.
- `sudo` access for iSCSI checks and cleanup.
- `iscsiadm` available on nodes that will stage volumes.
- `sw-block` binary in `PATH`, or run `go run ./cmd/sw-block ...` from this
repository.
- the `sw-block` CLI and a checkout of the release tag (Step 0).
Check the cluster:
@@ -66,43 +65,65 @@ at least one Ready node
iscsiadm: No active sessions.
```
## Step 0 - Build The CLI
## Step 0 - Get The Repository And The CLI
If `sw-block` is not already installed in `PATH`, build it from this
repository:
> **v1.1.0 is affected: do not use it for this procedure.** Its generated
> blockvolume pod cannot start: it cannot create `/run/sw-block` as uid 65532,
> and its node TLS Secret must also be found in the app's namespace. Use the
> first release that contains both fixes; its release notes name them. This
> procedure is validated only on that release.
Run everything from a checkout of the **release tag** you install, so the chart,
the scripts and the images match. Set `TAG` to that release:
```bash
go build -o sw-block ./cmd/sw-block
TAG=<the fixed release tag> # not v1.1.0, see above
git clone --depth 1 --branch $TAG https://github.com/seaweedfs/seaweed-block && cd seaweed-block
```
**kubectl access.** On k3s, `/etc/rancher/k3s/k3s.yaml` is readable only by root
unless k3s was installed with `--write-kubeconfig-mode 0644`. Give your user its
own copy:
```bash
mkdir -p ~/.kube && sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chown "$(id -u):$(id -g)" ~/.kube/config && chmod 600 ~/.kube/config
export KUBECONFIG=$HOME/.kube/config
kubectl get nodes
```
On other distributions, keep your existing `KUBECONFIG`.
**The `sw-block` CLI.** Take it from the release tarball (see
[operations manual, section 1](operations-manual.md#1-install-the-binaries-and-units)
for the checksum step):
```bash
curl -fsSLO https://github.com/seaweedfs/seaweed-block/releases/download/$TAG/sw-block-$TAG-linux-amd64.tar.gz
curl -fsSLO https://github.com/seaweedfs/seaweed-block/releases/download/$TAG/SHA256SUMS
sha256sum -c --ignore-missing SHA256SUMS && tar -xzf sw-block-$TAG-linux-amd64.tar.gz --strip-components=1
export PATH="$PWD:$PATH"
sw-block --version
```
The release walkthrough uses `sw-block ops generate-helm-values`. `go run
./cmd/sw-block ...` is available as a fallback, but building the CLI first
matches what a user normally runs.
To build it instead, install the Go version that `go.mod` names, as in
[appendix A of the operations manual](operations-manual.md#appendix-a-build-from-source),
then run `go build -o sw-block ./cmd/sw-block`.
## Step 1 — Generate Helm Values
From the repository root:
```bash
export KUBECONFIG="${KUBECONFIG:-/etc/rancher/k3s/k3s.yaml}"
sw-block ops generate-helm-values \
--out values.day1.yaml \
--image ghcr.io/seaweedfs/seaweed-block:sha-dc2972d0059b \
--csi-image ghcr.io/seaweedfs/seaweed-block-csi:sha-dc2972d0059b
--image ghcr.io/seaweedfs/seaweed-block:$TAG \
--csi-image ghcr.io/seaweedfs/seaweed-block-csi:$TAG
```
The `KUBECONFIG` fallback above is the common k3s path. Non-k3s users should
keep their existing `KUBECONFIG`. Fresh k3s installs may keep
`/etc/rancher/k3s/k3s.yaml` readable only by root unless k3s was started with a
readable kubeconfig mode.
If `sw-block` is not installed:
```bash
go run ./cmd/sw-block ops generate-helm-values --out values.day1.yaml
```
Use the images of the same release as the checkout: the chart passes flags
(for example `--tls-cert` and `--master-tls-cert`) that older images do not
know, and such a pod restarts in a loop until `helm install --wait` times out.
What this command does:
@@ -129,41 +150,26 @@ Inspect the generated values:
grep -E "externalISCSI|externalStatus|replicationFactor|ackProfile|enabled:|internalIP" values.day1.yaml
```
For release validation, use immutable images:
To check what you pulled, compare the image index digests with the ones on the
release page of `$TAG`.
```bash
sw-block ops generate-helm-values \
--out values.day1.yaml \
--image ghcr.io/seaweedfs/seaweed-block:sha-<commit> \
--csi-image ghcr.io/seaweedfs/seaweed-block-csi:sha-<commit>
```
Current validated published quickstart image tag:
`sha-dc2972d0059b`. It covers the v0.4 read-only/status path; later paths
need matching images, see [release images](kubernetes-status.md#release-images).
Published image digests:
```text
seaweed-block
index: sha256:b8da5ca4e2bbe2f0f630fee0468790c444362615d68807a1be31fd237c84928f
linux/amd64: sha256:677f6321ea5199b14792345b8691358860bb9ca7376f4e4a2f3a7c0113d5db9b
seaweed-block-csi
index: sha256:b5942cd68d28aecdfebec1f1e5ec55a9cafe746169fee3b6c35916c93fffcaa6
linux/amd64: sha256:1fc636a4e0e63cc8cbee39e6775053c5d1aba7213ca9182a084e1bb6fe71474c
```
Mutable `:alpha` is a smoke/demo tag only. Do not use it as release evidence
unless the publish commit is known.
Use release tags (`vX.Y.Z`). A `sha-<commit>` tag exists only for some commits,
and an old one does not match a newer chart. Mutable `:alpha` is a smoke/demo tag only. Do not use it as release
evidence.
## Step 2 — Install Seaweed Block With Helm
blockmaster listens on the pod network only with mutual TLS, so create its
Secrets first. For a trial, the helper issues a development CA and one node
certificate per server id (the `blockNodes[]` names, or their `serverID`):
certificate per server id. The server ids must be exactly the `blockNodes[].name`
values in `values.day1.yaml` (or their `serverID`, where set). Read them from the
file instead of typing them; `generate-helm-values` prints `node-a node-b node-c`
as placeholders:
```bash
bash scripts/k8s-alpha-certs.sh kube-system ~/.sw-block-alpha-tls node-a node-b node-c
NODES=$(awk '/^blockNodes:/{f=1; next} f && /^[^ -]/{f=0} f && /^ *- name:/{print $3}' values.day1.yaml)
echo $NODES # your node names, for example az1-c4a az1-c4b az1-c4c
bash scripts/k8s-alpha-certs.sh kube-system ~/.sw-block-alpha-tls $NODES
```
It applies `sw-block-master-tls`, `sw-block-roles`, one Secret per in-cluster
@@ -348,12 +354,37 @@ kubectl apply -f examples/kubernetes/basic-app/writer-pod.yaml
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded pod/sw-block-example-writer --timeout=240s
kubectl logs sw-block-example-writer
WRITER_NODE=$(kubectl get pod sw-block-example-writer -o jsonpath='{.spec.nodeName}')
kubectl delete pod sw-block-example-writer
kubectl apply -f examples/kubernetes/basic-app/reader-pod.yaml
```
**Several nodes: read on another node.** To show that the data follows the
volume, run the reader on a node other than the writer's. The node must be Ready
and run a CSI node plugin pod: setting `spec.nodeName` bypasses the scheduler, so
pick it from the plugin pods:
```bash
READER_NODE=$(kubectl -n kube-system get pods -l app=sw-block-csi-node --field-selector=status.phase=Running \
-o jsonpath='{range .items[*]}{.spec.nodeName}{"\n"}{end}' | grep -vx "$WRITER_NODE" |
while read -r n; do
test "$(kubectl get node "$n" -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}')" = True && echo "$n"
done | head -1)
echo "reader node: ${READER_NODE:-none eligible}"
test -n "$READER_NODE" &&
kubectl patch --local -f examples/kubernetes/basic-app/reader-pod.yaml --type merge \
-p "{\"spec\":{\"nodeName\":\"$READER_NODE\"}}" -o yaml | kubectl apply -f -
kubectl wait --for=jsonpath='{.status.phase}'=Succeeded pod/sw-block-example-reader --timeout=240s
kubectl logs sw-block-example-reader
echo "writer ran on $WRITER_NODE, reader on $(kubectl get pod sw-block-example-reader -o jsonpath='{.spec.nodeName}')"
```
If it prints `none eligible`, no other node qualifies, and the cross-node read is
not shown; use the single-node path below.
**One node:** apply `examples/kubernetes/basic-app/reader-pod.yaml` unchanged.
The reader then runs on the writer's node. The helper in Step 3 does not choose
nodes either.
The generated `blockvolume` workload is reconciled by blockmaster. You should
not manually apply generated blockvolume YAML on the supported alpha path.
@@ -398,17 +429,44 @@ scheduling mismatch.
Attach the artifact directory and any `/tmp/sw-block-report` output when filing
an issue.
**After a failed helper run**, the example resources stay (StorageClass, PVC and
PV, the writer or reader pod, the generated blockvolume Deployment). Remove them
before running the helper again or uninstalling:
```bash
kubectl delete pod sw-block-example-writer sw-block-example-reader --ignore-not-found
kubectl delete -f examples/kubernetes/basic-app/storageclass-pvc.yaml --ignore-not-found
kubectl get pv,deploy -A | grep sw-block-example || echo "example resources gone" # the PV and Deployment go within seconds
```
## Cleanup
The first-volume helper cleans the example resources by default. To uninstall
the alpha stack:
The first-volume helper cleans the example resources by default (after a failed
run, see Troubleshooting first). To uninstall the alpha stack:
```bash
helm uninstall sw-block --namespace kube-system
bash scripts/uninstall-k8s-alpha.sh "$PWD"
# the Step 2 TLS Secrets: the uninstall leaves them
kubectl -n kube-system delete secret sw-block-master-tls sw-block-roles sw-block-csi-controller-tls \
sw-block-csi-node-tls sw-block-operator-status-tls sw-block-failback-executor-tls --ignore-not-found
kubectl -n kube-system get secret -o name | grep '^secret/sw-block-node-tls-' | xargs -r kubectl -n kube-system delete
bash scripts/verify-helm-cleanup.sh
```
Two things stay on purpose:
- **The custom resource definitions.** Helm never deletes CRDs, and the uninstall
script removes only `swblockreplicafailbacks`. The other five
(`swblockclusters`, `swblockfrontendpublications`, `swblockreplicaeligibilities`,
`swblockreplicarebuilds`, `swblockvolumes`, all `.block.seaweedfs.com`) stay, and a
later install reuses them. To remove them, and every object of those kinds:
`kubectl delete -f charts/seaweed-block/crds/ --ignore-not-found`.
- **An empty kubelet plugin directory** on each node,
`/var/lib/kubelet/plugins/block.csi.seaweedfs.com`. It holds nothing; remove it
on each node with `sudo rmdir /var/lib/kubelet/plugins/block.csi.seaweedfs.com`
if you want. The verifier's `hostpath_residue_count` does not look at it.
The uninstall script removes Kubernetes resources and scrubs Seaweed Block
iSCSI sessions and iSCSI node DB records. The verifier checks the same residue
classes used by release QA.