{
 "診斷流程:describe、logs 與 events#1": {
  "type": "flow",
  "reveal": [
   0,
   0,
   4
  ],
  "nodes": [
   {
    "label": "看狀態"
   },
   {
    "label": "讀事件"
   },
   {
    "label": "看日誌"
   },
   {
    "label": "下結論",
    "kind": "end"
   }
  ],
  "layout": "row"
 },
 "診斷流程:describe、logs 與 events#2": {
  "type": "flow",
  "reveal": [
   0,
   1,
   2,
   3,
   3,
   4
  ],
  "nodes": [
   {
    "label": "看全貌",
    "sub": "get pods"
   },
   {
    "label": "讀事件",
    "sub": "describe 的 Events"
   },
   {
    "label": "看日誌",
    "sub": "logs"
   },
   {
    "label": "進去看",
    "sub": "exec / debug",
    "kind": "end"
   }
  ],
  "layout": "row"
 },
 "診斷流程:describe、logs 與 events#4": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "步驟",
   "指令"
  ],
  "rows": [
   [
    "看全貌",
    "kubectl get pods -o wide"
   ],
   [
    "多種資源",
    "kubectl get deploy,rs,svc,ingress"
   ],
   [
    "找異常",
    "kubectl get pods -A | grep -v Running"
   ],
   [
    "讀事件",
    "kubectl describe pod POD"
   ]
  ],
  "widths": [
   2,
   8
  ]
 },
 "診斷流程:describe、logs 與 events#6": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "cards": [
   {
    "title": "-c 容器名稱",
    "points": [
     "Pod 有多個容器時",
     "指定看哪一個"
    ]
   },
   {
    "title": "--previous",
    "points": [
     "上一個崩潰容器的日誌"
    ]
   },
   {
    "title": "-l app=web",
    "points": [
     "依標籤看多個 Pod",
     "--tail=50 取最後 50 行"
    ]
   },
   {
    "title": "-f",
    "points": [
     "持續追蹤最新輸出"
    ]
   }
  ]
 },
 "常見故障症狀解析#1": {
  "type": "table",
  "reveal": [
   0,
   0,
   1,
   2,
   3,
   4
  ],
  "head": [
   "錯誤訊息",
   "可能原因"
  ],
  "rows": [
   [
    "not found / manifest unknown",
    "映像名稱或標籤打錯"
   ],
   [
    "pull access denied",
    "倉庫不存在,或私有倉庫沒給憑證"
   ],
   [
    "too many requests",
    "公開倉庫的拉取次數限制"
   ],
   [
    "i/o timeout、解析失敗",
    "節點到倉庫的網路或 DNS 有問題"
   ]
  ],
  "widths": [
   4,
   6
  ]
 },
 "常見故障症狀解析#3": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "cards": [
   {
    "title": "應用啟動失敗",
    "points": [
     "缺少設定、連不上資料庫",
     "logs --previous 看錯誤"
    ]
   },
   {
    "title": "command 寫錯",
    "points": [
     "結束碼 127 或 126",
     "或立刻以 0 結束"
    ]
   },
   {
    "title": "缺環境變數",
    "points": [
     "Secret 或 ConfigMap 沒掛載"
    ]
   },
   {
    "title": "OOMKilled",
    "points": [
     "結束碼 137",
     "調整 limits"
    ]
   },
   {
    "title": "liveness 太嚴格",
    "points": [
     "Liveness probe failed",
     "Killing"
    ]
   }
  ]
 },
 "常見故障症狀解析#6": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5,
   5
  ],
  "head": [
   "Events 訊息",
   "原因"
  ],
  "rows": [
   [
    "Insufficient cpu / memory",
    "requests 超過節點可分配量"
   ],
   [
    "untolerated taint",
    "缺少對應的 toleration"
   ],
   [
    "node selector / affinity",
    "找不到符合條件的節點"
   ],
   [
    "PVC 未綁定",
    "describe pvc,確認 StorageClass"
   ],
   [
    "ResourceQuota 超額",
    "建立時被拒絕,Forbidden"
   ]
  ],
  "widths": [
   4,
   6
  ]
 },
 "常見故障症狀解析#7": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3
  ],
  "cards": [
   {
    "title": "MountVolume 失敗",
    "points": [
     "ConfigMap 或 Secret not found",
     "引用的資源不存在"
    ]
   },
   {
    "title": "Multi-Attach",
    "points": [
     "RWO 磁碟",
     "還掛在另一個節點"
    ]
   },
   {
    "title": "CNI 網路",
    "points": [
     "建立容器網路失敗",
     "CNI 網路外掛的問題"
    ]
   }
  ]
 },
 "網路與服務故障排查#1": {
  "type": "flow",
  "reveal": [
   0,
   0,
   0,
   6
  ],
  "nodes": [
   {
    "label": "使用者"
   },
   {
    "label": "DNS"
   },
   {
    "label": "入口",
    "sub": "Ingress、LB、NodePort"
   },
   {
    "label": "Service"
   },
   {
    "label": "Pod"
   },
   {
    "label": "應用",
    "kind": "end"
   }
  ],
  "layout": "snake"
 },
 "網路與服務故障排查#2": {
  "type": "table",
  "reveal": [
   0,
   1,
   2,
   3,
   4,
   5
  ],
  "head": [
   "檢查",
   "重點"
  ],
  "rows": [
   [
    "1 應用本身",
    "port-forward 直連 Pod,繞過 Service"
   ],
   [
    "2 Service",
    "Selector 與 Endpoints 要有值"
   ],
   [
    "3 埠對應",
    "targetPort 要是容器實際監聽的埠"
   ],
   [
    "4 叢集內測試",
    "IP 通、名稱不通,就是 DNS 問題"
   ],
   [
    "5 DNS",
    "CoreDNS 的 Pod 必須是 Running"
   ]
  ],
  "widths": [
   3,
   7
  ]
 },
 "網路與服務故障排查#5": {
  "type": "flow",
  "reveal": [
   0,
   0,
   1,
   3
  ],
  "nodes": [
   {
    "label": "Service",
    "sub": "port: 80"
   },
   {
    "label": "targetPort",
    "sub": "8080"
   },
   {
    "label": "容器",
    "sub": "實際監聽的埠",
    "kind": "end"
   }
  ],
  "layout": "row"
 },
 "課程總整理與下一步#5": {
  "type": "cards",
  "reveal": [
   0,
   1,
   2,
   3,
   4
  ],
  "cards": [
   {
    "title": "映像",
    "points": [
     "具體版本標籤或 digest",
     "不用 latest",
     "來自可信倉庫"
    ]
   },
   {
    "title": "安全",
    "points": [
     "runAsNonRoot",
     "不允許提升權限",
     "drop ALL capabilities",
     "不使用 privileged"
    ]
   },
   {
    "title": "資源",
    "points": [
     "每個容器設 requests",
     "記憶體 limits 合理",
     "Namespace 有 ResourceQuota"
    ]
   },
   {
    "title": "探針",
    "points": [
     "readinessProbe 一定要設",
     "liveness 輕量保守",
     "慢啟動用 startupProbe"
    ]
   }
  ]
 }
}