Hello World Dev Conference
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- GA: UA-34467841-15 --- # 你不是 SRE,但活在 K8s 的叢林裡:開發者的 K8s 求生指南 - 蔡宗城 (smalltown) ###### tags: `HelloWorld2025` `HWDC2025` `2025` `DE 會議室` `容器化和容器調度` <blockquote> 在許多團隊中,Kubernetes 被視為 SRE 的神秘領域。但當你開發的應用被部署在 K8s 中時,你就已經身處其中。這場分享不講 HPA 參數怎麼調,也不會手把手寫 Helm Chart,而是聚焦在:開發人員在日常工作中,該具備哪些 Kubernetes 基礎意識與協作文化,才能更順暢地開發、測試、Debug 與合作? 我們將從真實案例出發,談談: 開發、QA、PM 在「不了解 Kubernetes」時,容易犯的錯與溝通誤區 如何用「對的語言」跟 SRE 合作,例如報錯不要只說「系統壞了」 K8s 核心概念圖解:Pod、Job、Secret、Ingress 到底是什麼,跟你有什麼關係? 團隊怎麼建立共通語言與自助文化,讓非 SRE 也能看 log、觸發部署、排查問題 這不是一場技術教學,而是關於如何讓 K8s 成為全體工程團隊的合作工具,而不只是某個角色的專業領地。 </blockquote> {%hackmd @HWDC/announcement-2025 %} ## 會議資訊 **時間:** 14:20 ~ 15:05 **地點:** DE 會議室 **日期:** 2025年10月14日 **語言:** 中文 **難度:** 中階 **相關連結:** - [Hello World Dev Conference 2025 官方網站](https://hwdc.ithome.com.tw/2025) [target=_blank] - [Hello World 2025 議程表](https://hwdc.ithome.com.tw/2025/agenda) [target=_blank] ## 筆記區 ### 🎯 TL;DR * **大創意**:學會用 **K8s 的語言**,才能在叢林裡活下去。 * 不當 YAML 工程師也能:**說對話、問對題、按對鈕**。 * 帶走三件套:**共通語言**、**最小概念(Pod/Job/Secret/Ingress)**、**自助清單**。 --- ### 👥 受眾與目標 * **對象**:開發、QA、PM、SRE(跨角色合作)。 * **目標**: 1. 降低溝通成本與救火頻率 2. 建立可定位的回報方式 3. 形成自助文化與平台化入口 --- ### 🧭 故事路標 * **背景 & 人物(Why)**:K8s 不是 SRE 的黑盒;所有角色都在用。 * **衝突**:報錯模糊/語言不通/自助不足 → 進度延誤、SRE 變消防隊。 * **大創意(What)**:用 K8s 的語言合作。 * **結局(How)**:最小概念+報錯模板+自助流程+平台支撐(IDP)。 --- ### 🌳 背景重點(Why) * 你的 **commit → pipeline → 上線** 都落在 K8s。 * 角色四象限:**Dev/QA/PM/SRE** 都倚賴同一套平台。 * **同舟共濟**:把黑盒變透明,先從語言與最小觀念開始。 --- ### 🔥 衝突三連擊 1. **報錯模糊**:只有「壞了」。 2. **缺乏共通語言**:Env/Service/Time/Error 不完整。 3. **自助不足**:小事都要找 SRE,救火不止。 > 影響:進度卡關、摩擦上升、可靠性改善被擠壓。 --- ### 💡 大創意(金句) > **學會用 K8s 的語言,才能在叢林裡活下去。** > 不必成為專家,但要能提供 **可定位的線索**。 **不學的代價**:高溝通成本|定位變慢|自助不足|決策風險|職涯受限。 --- ### 🧩 最小概念四兄弟(講人話版) * **Pod = 應用真正跑的地方**:先問 namespace / pod 名 / 狀態(Running/Pending/CrashLoop)。 * **Job = 批次任務**:一次做完;看成功/失敗/重試次數(`backoffLimit`、`activeDeadlineSeconds`)。 * **Secret = 保險箱**:金鑰、密碼、憑證;重視命名、輪替、最小權限。 * **Ingress = 大門**:域名/路由/TLS;網站進不去不一定是服務壞,可能是門鎖或證書過期。 --- ### 🗣️ 共通語言:錯誤回報模板(可複製) ```text [環境] staging / production [服務] auth-service(namespace: auth) [時間] 2025-08-31 10:15 (+08) [狀態] Pod CrashLoopBackOff(或 OOMKilled/Pending/ImagePullBackOff) [線索] 近 50 行 log(截圖/附件)、重現步驟、最近變更(版本/Secret/Config) ``` > 核心四要素:**Env / Service / Time / Error**。 --- ### 🧰 自助清單(先做再找人) 1. **CI/CD**:Pipeline 是否綠燈? 2. **Pod 狀態**:`kubectl get pods -n <ns>` 是否 Running? 3. **健康檢查 / 簡單 API**:基本功能是否通? 4. **Log**:先看近 50 行、有無持續錯誤?(需時用 `-f`、啟動期用 `--previous`) 5. **可回滾?**:若上版後退化明顯 → 走受控回滾(ArgoCD/Flux)。 **常用指令速記**: ```bash kubectl get pods -n <ns> kubectl describe pod <pod> -n <ns> kubectl logs <pod> -n <ns> [-c <container>] [--previous] [-f] ``` --- ### 🧭 自助決策樹(文字版) * 能重現嗎?→ 不能:補充時間軸/樣本/指標;能:繼續 * 影響單一服務嗎?→ 否:檢查網路/DB/依賴;是:檢查該服務 Pod/Deployment * 資源是否不足?(Pending/節點壓力)→ 調整 requests/limits 或等排程 * 重啟後是否恢復?→ 是:追變更;否:看啟動期 Log、依賴健康 * 是否可安全回滾?→ 能:走 GitOps 受控回滾;不能:升級為 SRE 支援 > 向 SRE 求助時,附上「已做過的檢查」可大幅加速。 --- ### 🛠️ 推薦工具(看得到 → 用得起 → 自助改) * **觀測與可視**:K8s Dashboard、Lens、k9s(QA/Dev 友善)。 * **部署與回滾**:ArgoCD、Flux(GitOps;提供「受控回滾按鈕」)。 * **知識與入口**:Backstage / 內部 Portal(Service Catalog、Runbook、On-call)。 --- ### 🧪 案例速覽 * **ArgoCD + 自助回滾**:開發者在權限控管與審核下,自主回滾,半夜救火電話減半。 * **k9s for QA**:一鍵看 Pod/Log,回報可附 Pod 名與錯誤片段,定位大幅加快。 * **Backstage**:服務清單、Runbook、值班資訊、健康狀態同頁呈現,PM 也能找到正確入口。 --- ### 🧱 從工具到文化 * 工具解短痛:降低資訊搜尋與操作門檻。 * 文化解長痛:固定模板、SRE Office Hour、回顧機制讓習慣沉澱。 * 目標:**SRE 從救火隊 → 可靠性推手**。 --- ### 🚀 推廣路線圖(落地指南) 1. **小團隊試點**:挑願意嘗鮮的 Squad。 2. **內訓與模板化**:把經驗變教材、票單模板、Runbook。 3. **每月回顧**:用數據看救火是否下降、回滾是否順、誤報是否減。 --- ### 📏 成功指標(Before/After) * 半夜警報 / on-call 次數 ↓ * 救火工單占比 ↓、定位時間(MTTD/MTTI) ↓、修復時間(MTTR) ↓ * 可靠性改善專案數 ↑(容量管理 / 錯誤預算 / 自動化) --- ### 🧠 常見 K8s 狀態詞彙小抄 * **CrashLoopBackOff**:啟動期錯誤持續重啟(先看 `--previous` Log)。 * **ImagePullBackOff**:拉不到鏡像(憑證/Registry/Tag)。 * **OOMKilled**:記憶體不足(檢查 limits/程式記憶體尖峰)。 * **Pending**:排程不上(資源不足/污點/節點壓力/親和性)。 --- ### 📝 範本與範例 **錯誤回報模板**:見上方〈共通語言〉章。 **自助清單**:見上方〈自助清單〉章。 **決策樹**:見上方〈自助決策樹〉章。 > 建議將三者放入團隊 Wiki / Backstage / Notion,提供「一鍵複製」。 --- ### 🧩 參考實作(可選) * **Service Catalog** 欄位:Owner / Repo / Namespace / Ingress Host / Runbook / On-call / SLO / 最近發版。 * **回滾按鈕** 風險控管:環境白名單、審核節點、變更記錄、速回通知。 --- ### 🏁 收尾金句 > **學會用 K8s 的語言,才能在叢林裡活下去。** > 語言一致、概念到位、工具上手 → 少救火、多交付。 --- ### 🙋 Q&A 把你的真實情境丟上來,我們一起把模板套進去: * 你們的環境/服務/時間/錯誤碼是? * 你已經嘗試過哪些自助步驟? * 需要哪個入口(Log / 部署 / 回滾 / Runbook)? --- ### 📣 We’re Hiring! 想把「複雜變簡單」並把平台做成**人人用得起**?歡迎聊聊:SRE、微服務後端、資安工程師。 ## 討論區 > 歡迎在此進行討論與 Q&A ## 相關資源 - 投影片連結:[連結在此](https://www.slideshare.net/slideshow/hello-world-dev-conference-2025-sre-k8s-k8s/283888161) - 相關文件:(待更新)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully