Skip to content

docs: expand volumes chapter with storage patterns and advanced topics#4

Merged
r97221004 merged 11 commits into
masterfrom
docs/update-volume-chapter
Jul 1, 2026
Merged

docs: expand volumes chapter with storage patterns and advanced topics#4
r97221004 merged 11 commits into
masterfrom
docs/update-volume-chapter

Conversation

@r97221004

Copy link
Copy Markdown
Owner

Summary

  • Add emptyDir medium: Memory (tmpfs) with Secret-volume connection
  • Add full accessModes table: RWO / ROX / RWX / RWOP with backend requirements
  • Add kubectl wait commands to prevent race conditions in lab steps
  • Add k9s workflows for PVC/PV/StorageClass inspection and cleanup verification
  • Add Reclaim policy section (Delete vs Retain) with VolumeBindingMode explanation
  • Add Volume expansion section (allowVolumeExpansion, patch PVC, shrink limitation)
  • Fix k9s step that incorrectly described bare Pod as auto-restarting Deployment
  • Expand volumeClaimTemplate best practice with concrete explanation
  • Add RWOP best practice for single-writer workloads

Test plan

  • Read through the full chapter end-to-end for flow and accuracy
  • Apply manifests/config-and-data/data-pvc.yaml and run the lab verification commands
  • Confirm k9s commands (:pvc, :pv, :sc) work as described
  • Verify kubectl wait commands behave correctly after apply and delete

🤖 Generated with Claude Code

r97221004 and others added 11 commits June 29, 2026 13:53
AS IS: chapter covered basic PVC usage but omitted emptyDir tmpfs,
the full accessModes matrix, reclaim policy implications, and had no
k9s workflows; the volumeClaimTemplate best practice lacked explanation,
and a k9s step incorrectly described a bare Pod as a Deployment

TO BE: add emptyDir medium:Memory with its Secret-volume connection,
a three-mode accessModes table with backend requirements, a Reclaim
policy section comparing Delete vs Retain, step-by-step k9s workflows
for PVC inspection and persistence verification, and fix the bare-Pod
restart behavior in the k9s steps

TASK # N/A
AS IS: prose had minor inaccuracies (Pod restart vs container recreate),
accessModes table omitted RWOP, kubectl steps had no wait commands causing
potential race conditions, reclaim policy section omitted VolumeBindingMode
which is a common source of Pending PVC confusion, and k9s workflows lacked
StorageClass inspection and cleanup verification steps

TO BE: fix ephemeral filesystem description to mention image layer and
container recreation, add RWOP mode with single-writer use case, add
kubectl wait commands for reliable sequencing, add VolumeBindingMode
section with Immediate vs WaitForFirstConsumer explanation, and extend
k9s workflows to cover StorageClass inspection and cleanup verification

TASK # N/A
AS IS: chapter had no guidance on resizing a full PVC, leaving readers
without recourse when storage runs out in production

TO BE: add a Volume expansion section covering how to check if a
StorageClass allows expansion, how to patch a PVC to a larger size,
what Kubernetes does during the resize, and that shrinking is not
supported — so readers can handle capacity issues without recreating
their storage

TASK # N/A
AS IS: intro used an abstract sentence to describe when Volumes vs
PersistentVolumes survive; volume expansion gave no guidance on when
a Pod restart is actually needed.

TO BE: intro now leads with a survival-layer table and a concrete
local/external drive analogy; volume expansion section distinguishes
online vs offline expansion and points to FileSystemResizePending
as the actionable indicator.

TASK # N/A

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AS IS: the kubeadm StorageClass warning appeared after Volume Expansion,
after readers had already tried (and likely failed) the PVC exercise;
ConfigMap/Secret volume types were not mentioned; hostPath had no
explanation; dynamic vs static provisioning was not covered.

TO BE: move the kubeadm warning before the runnable manifest so readers
set up a StorageClass first; add ConfigMap/Secret bridging note with
subPath live-update caveat; add dynamic vs static provisioning table;
add multi-node local-path debugging hints; clarify hostPath definition
and add subPath best practice bullet.

TASK # N/A

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AS IS: the chapter dives straight into emptyDir without telling readers
what it covers or what to skip; the mental model for Pod→PVC→PV is
spread across several paragraphs; the volume expansion section appears
at the same visual weight as core concepts.

TO BE: add a scope paragraph so readers know what the chapter covers
before they start; condense the storage chain into a short bullet list
to reinforce the mental model; mark volume expansion as "Advanced" with
a skip note; reframe the hostPath best practice positively.

TASK # N/A

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AS IS: both sections only showed abstract YAML snippets without
volumeMounts or runnable examples; readers had no way to observe
the behaviors being described.

TO BE: add a sidecar manifest and three-step exercise for emptyDir
that proves volume lifetime (survives container restart, dies with Pod);
add a kubectl exec walkthrough for ConfigMap/Secret volumes showing
how keys land as files on disk. Move config volumes into their own
section so the emptyDir section stays focused.

TASK # N/A

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AS IS: data-pvc.yaml contained both the PVC and the Pod in one file,
implying they share a lifecycle — readers applying this pattern in
production risk accidentally deleting data when they delete a workload.

TO BE: extract the Pod into data-writer.yaml so PVC and workload are
managed independently; update all kubectl commands, k9s steps, and
cleanup sections in volumes.md and statefulset.md to match.

TASK # N/A

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AS IS: the PVC example omits storageClassName without explanation,
leaving readers unsure how StorageClass — described in the flow above
— actually appears in a manifest.

TO BE: add a comment in the YAML and a short explanation showing that
omitting storageClassName uses the cluster default, with an explicit
example for when a specific storage tier is needed.

TASK # N/A

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AS IS: the reclaim policy section opens with an abstract definition
that doesn't connect to what the reader just observed in the exercise,
leaving them unsure why data survived Pod deletion or when it would not.

TO BE: open with the exercise result and a survival table covering all
four cases (same PVC remounted, no mount, PVC deleted, emptyDir); name
local-path's Delete default so readers know cleanup actually destroys data.

TASK # N/A

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AS IS: the note about Deployments was a single sentence that didn't
explain the implication — readers could unknowingly deploy a database
as a multi-replica Deployment and corrupt data.

TO BE: expand into a paragraph with a table contrasting read-only vs
write-heavy workloads, and point to StatefulSet volumeClaimTemplates
as the correct pattern for workloads that need per-replica storage.

TASK # N/A

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@r97221004
r97221004 merged commit 12df71c into master Jul 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant