Repository navigation
k8s basic doc - #9
Merged
Merged
Conversation
nchj
commented
Aug 31, 2026
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
…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.
|
Jsodogkjgjf |
|
Nebejjdjd |
inestna09-debug
approved these changes
Oct 24, 2026
|
Jiooeidj |
|
Kookwk |
|
ดีี |
|
ดีมากคับแบบบบบ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.