Skip to content

k8s basic doc - #9

Merged
nchj merged 12 commits into
mainfrom
k8s-basic-doc
Aug 31, 2026
Merged

nchj merged 12 commits into
mainfrom
k8s-basic-doc

Conversation

@nchj

@nchj nchj commented Aug 31, 2026

Copy link
Copy Markdown
Owner
  • initial version of k8s by AI
  • fix build error
  • add metadata
  • docs(k8s-training): update k8s tutorial content and add mermaid diagram support
  • fix(k8s-training): define missing ok() helper in cleanup.sh
  • fix(k8s-training): stop deploy.sh aborting on secret lookup failure
  • fix(k8s-training): honor $KUBECONFIG in cleanup.sh
  • fix(k8s-training): let cleanup verification detect a deleted namespace
  • fix(k8s-training): add frontmatter so practice/README shows in navigation
  • fix(k8s-training): rename section index to index.md
  • fix(k8s-training): roll back to the actual previous Helm revision
  • fix(k8s-training): move -n $NS before -- in kubectl exec example

nchj added 12 commits May 15, 2026 00:28
…am support

- Update all k8s training chapters (architecture, pod, service, scheduling, security, operations, interview)
- Replace ASCII chapter diagram with mermaid flowchart in README
- Add vitepress-plugin-mermaid dependency for diagram rendering
cleanup.sh called ok() at lines 31/40/50/52/60, but only info() and
warn() were defined. Under `set -e` the undefined command aborted the
script with exit 127 immediately after `helm uninstall`, so namespace
and PVC deletion never ran and the reader was left believing cleanup
had completed.
The DB_HOST lookup used a bare command substitution under `set -e`
with no fallback, unlike the ConfigMap and Secret-key lookups nearby.
Any failure of `kubectl get secret` - e.g. an RBAC role that permits
deploying but not reading Secrets, which Step 0 does not check - killed
the script silently in Step 6, skipping the DNS, rolling-update and
rollback lessons along with the final summary.
cleanup.sh hardcoded $HOME/.kube/config, ignoring the $KUBECONFIG env
var that deploy.sh:15 honors. A reader who deployed to a kind cluster
via `export KUBECONFIG=...`, exactly as deploy.sh:73 instructs, would
have cleanup silently target whatever cluster ~/.kube/config points at
and delete the k8s-training namespace there.
The check discarded stderr, so when the namespace was gone REMAINING
held only the fallback string "Namespace 不存在", while the branch
grepped for "namespace.*not found" - text that could never reach it.
Every successful cleanup therefore ended in a false "possible leftover
resources" alarm. Capture stderr so the real kubectl NotFound error is
what gets matched.
…tion

practice/README.md had no frontmatter, so isArchivePost (content.mts:87)
saw an empty title and dropped the page. It built and was reachable by
URL, but appeared in neither the sidebar nor the /posts/ archive, so a
reader following the chapter 6 link could not find it from any listing.
toPostUrl (content.mts:125) strips only index.md, so a README.md
section index is served at /posts/k8s-training/README and plain
/posts/k8s-training/ returns 404. Every other post directory (zero-copy,
java, java/springboot, java/multithread) uses index.md, and no file
links to ./README.md, so nothing breaks. Verified the build now emits
dist/posts/k8s-training/index.html.
deploy.sh hardcoded `helm rollback $RELEASE_NAME 1` while announcing
"回滚到上一版本". That is only correct on a first-ever run: on a re-run
the upgrade at line 131 comes first, so revision 1 is several versions
back and the rollback silently reverts every values.yaml change made
since installing. practice/README.md:73 explicitly encourages
`--set replicaCount=5`, so a reader following the docs loses that edit.
Capture the current revision before upgrading and roll back to it.
practice/README.md had `kubectl exec -it deployment/training-app -- sh
-n $NS`, so the namespace flag fell after -- and was passed to sh
rather than kubectl, running the command against the default namespace
and producing a cryptic error. The neighbouring kubectl logs line
already had the correct ordering.
@nchj
nchj merged commit 3f13e72 into main Aug 31, 2026
3 checks passed
@nchj
nchj deleted the k8s-basic-doc branch August 31, 2026 16:00
@inestna09-debug

Copy link
Copy Markdown

Jsodogkjgjf

@inestna09-debug

Copy link
Copy Markdown

Nebejjdjd

@inestna09-debug

Copy link
Copy Markdown

Jiooeidj

@inestna09-debug

Copy link
Copy Markdown

Kookwk

@inestna09-debug

Copy link
Copy Markdown

ดีี

@inestna09-debug

Copy link
Copy Markdown

ดีมากคับแบบบบบ

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.

2 participants