From 369ccb7e7e71b710a87ec855ec83fc098a8f2177 Mon Sep 17 00:00:00 2001 From: roc Date: Thu, 11 Apr 2024 10:11:23 +0800 Subject: [PATCH] update at 2024-04-11 10:11:23 --- content/troubleshooting-cases/README.md | 3 + ...elete-rancher-ns-causing-node-disappear.md | 0 .../cluster/kubectl-exec-or-logs-failed.md | 0 ...er-snapshot-missing-causing-pod-pending.md | 0 .../high-load/disk-full-causing-high-cpu.md | 0 ...che-overflow-causing-healthcheck-failed.md | 0 .../cross-vpc-connect-nodeport-timeout.md | 0 .../network/dns-lookup-5s-delay.md | 0 ...bc-dns-id-conflict-causing-dns-abnormal.md | 0 .../node/cgroup-leaking.md | 0 ...dotnet-configuration-cannot-auto-reload.md | 0 ...d-to-modify-hosts-in-multiple-container.md | 0 .../others/job-cannot-delete.md | 0 ...n-system-time-causing-sandbox-conflicts.md | 0 ...-high-load-causing-pod-creation-timeout.md | 0 ...nt-root-causing-device-or-resource-busy.md | 0 ...l-image-fail-in-high-version-containerd.md | 0 content/troubleshooting-cases/sidebars.ts | 91 ++++++++++++++++++ content/troubleshooting/sidebars.ts | 93 ------------------- docusaurus.config.ts | 20 ++++ 20 files changed, 114 insertions(+), 93 deletions(-) create mode 100644 content/troubleshooting-cases/README.md rename content/{troubleshooting/cases => troubleshooting-cases}/cluster/delete-rancher-ns-causing-node-disappear.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/cluster/kubectl-exec-or-logs-failed.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/cluster/scheduler-snapshot-missing-causing-pod-pending.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/high-load/disk-full-causing-high-cpu.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/network/arp-cache-overflow-causing-healthcheck-failed.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/network/cross-vpc-connect-nodeport-timeout.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/network/dns-lookup-5s-delay.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/network/musl-libc-dns-id-conflict-causing-dns-abnormal.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/node/cgroup-leaking.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/others/dotnet-configuration-cannot-auto-reload.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/others/failed-to-modify-hosts-in-multiple-container.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/others/job-cannot-delete.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/runtime/broken-system-time-causing-sandbox-conflicts.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/runtime/io-high-load-causing-pod-creation-timeout.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/runtime/mount-root-causing-device-or-resource-busy.md (100%) rename content/{troubleshooting/cases => troubleshooting-cases}/runtime/pull-image-fail-in-high-version-containerd.md (100%) create mode 100644 content/troubleshooting-cases/sidebars.ts diff --git a/content/troubleshooting-cases/README.md b/content/troubleshooting-cases/README.md new file mode 100644 index 0000000..401ad3c --- /dev/null +++ b/content/troubleshooting-cases/README.md @@ -0,0 +1,3 @@ +# Kubernetes 排障案例 + +记录本人多年积累的 Kubernetes 相关的排障案例。 diff --git a/content/troubleshooting/cases/cluster/delete-rancher-ns-causing-node-disappear.md b/content/troubleshooting-cases/cluster/delete-rancher-ns-causing-node-disappear.md similarity index 100% rename from content/troubleshooting/cases/cluster/delete-rancher-ns-causing-node-disappear.md rename to content/troubleshooting-cases/cluster/delete-rancher-ns-causing-node-disappear.md diff --git a/content/troubleshooting/cases/cluster/kubectl-exec-or-logs-failed.md b/content/troubleshooting-cases/cluster/kubectl-exec-or-logs-failed.md similarity index 100% rename from content/troubleshooting/cases/cluster/kubectl-exec-or-logs-failed.md rename to content/troubleshooting-cases/cluster/kubectl-exec-or-logs-failed.md diff --git a/content/troubleshooting/cases/cluster/scheduler-snapshot-missing-causing-pod-pending.md b/content/troubleshooting-cases/cluster/scheduler-snapshot-missing-causing-pod-pending.md similarity index 100% rename from content/troubleshooting/cases/cluster/scheduler-snapshot-missing-causing-pod-pending.md rename to content/troubleshooting-cases/cluster/scheduler-snapshot-missing-causing-pod-pending.md diff --git a/content/troubleshooting/cases/high-load/disk-full-causing-high-cpu.md b/content/troubleshooting-cases/high-load/disk-full-causing-high-cpu.md similarity index 100% rename from content/troubleshooting/cases/high-load/disk-full-causing-high-cpu.md rename to content/troubleshooting-cases/high-load/disk-full-causing-high-cpu.md diff --git a/content/troubleshooting/cases/network/arp-cache-overflow-causing-healthcheck-failed.md b/content/troubleshooting-cases/network/arp-cache-overflow-causing-healthcheck-failed.md similarity index 100% rename from content/troubleshooting/cases/network/arp-cache-overflow-causing-healthcheck-failed.md rename to content/troubleshooting-cases/network/arp-cache-overflow-causing-healthcheck-failed.md diff --git a/content/troubleshooting/cases/network/cross-vpc-connect-nodeport-timeout.md b/content/troubleshooting-cases/network/cross-vpc-connect-nodeport-timeout.md similarity index 100% rename from content/troubleshooting/cases/network/cross-vpc-connect-nodeport-timeout.md rename to content/troubleshooting-cases/network/cross-vpc-connect-nodeport-timeout.md diff --git a/content/troubleshooting/cases/network/dns-lookup-5s-delay.md b/content/troubleshooting-cases/network/dns-lookup-5s-delay.md similarity index 100% rename from content/troubleshooting/cases/network/dns-lookup-5s-delay.md rename to content/troubleshooting-cases/network/dns-lookup-5s-delay.md diff --git a/content/troubleshooting/cases/network/musl-libc-dns-id-conflict-causing-dns-abnormal.md b/content/troubleshooting-cases/network/musl-libc-dns-id-conflict-causing-dns-abnormal.md similarity index 100% rename from content/troubleshooting/cases/network/musl-libc-dns-id-conflict-causing-dns-abnormal.md rename to content/troubleshooting-cases/network/musl-libc-dns-id-conflict-causing-dns-abnormal.md diff --git a/content/troubleshooting/cases/node/cgroup-leaking.md b/content/troubleshooting-cases/node/cgroup-leaking.md similarity index 100% rename from content/troubleshooting/cases/node/cgroup-leaking.md rename to content/troubleshooting-cases/node/cgroup-leaking.md diff --git a/content/troubleshooting/cases/others/dotnet-configuration-cannot-auto-reload.md b/content/troubleshooting-cases/others/dotnet-configuration-cannot-auto-reload.md similarity index 100% rename from content/troubleshooting/cases/others/dotnet-configuration-cannot-auto-reload.md rename to content/troubleshooting-cases/others/dotnet-configuration-cannot-auto-reload.md diff --git a/content/troubleshooting/cases/others/failed-to-modify-hosts-in-multiple-container.md b/content/troubleshooting-cases/others/failed-to-modify-hosts-in-multiple-container.md similarity index 100% rename from content/troubleshooting/cases/others/failed-to-modify-hosts-in-multiple-container.md rename to content/troubleshooting-cases/others/failed-to-modify-hosts-in-multiple-container.md diff --git a/content/troubleshooting/cases/others/job-cannot-delete.md b/content/troubleshooting-cases/others/job-cannot-delete.md similarity index 100% rename from content/troubleshooting/cases/others/job-cannot-delete.md rename to content/troubleshooting-cases/others/job-cannot-delete.md diff --git a/content/troubleshooting/cases/runtime/broken-system-time-causing-sandbox-conflicts.md b/content/troubleshooting-cases/runtime/broken-system-time-causing-sandbox-conflicts.md similarity index 100% rename from content/troubleshooting/cases/runtime/broken-system-time-causing-sandbox-conflicts.md rename to content/troubleshooting-cases/runtime/broken-system-time-causing-sandbox-conflicts.md diff --git a/content/troubleshooting/cases/runtime/io-high-load-causing-pod-creation-timeout.md b/content/troubleshooting-cases/runtime/io-high-load-causing-pod-creation-timeout.md similarity index 100% rename from content/troubleshooting/cases/runtime/io-high-load-causing-pod-creation-timeout.md rename to content/troubleshooting-cases/runtime/io-high-load-causing-pod-creation-timeout.md diff --git a/content/troubleshooting/cases/runtime/mount-root-causing-device-or-resource-busy.md b/content/troubleshooting-cases/runtime/mount-root-causing-device-or-resource-busy.md similarity index 100% rename from content/troubleshooting/cases/runtime/mount-root-causing-device-or-resource-busy.md rename to content/troubleshooting-cases/runtime/mount-root-causing-device-or-resource-busy.md diff --git a/content/troubleshooting/cases/runtime/pull-image-fail-in-high-version-containerd.md b/content/troubleshooting-cases/runtime/pull-image-fail-in-high-version-containerd.md similarity index 100% rename from content/troubleshooting/cases/runtime/pull-image-fail-in-high-version-containerd.md rename to content/troubleshooting-cases/runtime/pull-image-fail-in-high-version-containerd.md diff --git a/content/troubleshooting-cases/sidebars.ts b/content/troubleshooting-cases/sidebars.ts new file mode 100644 index 0000000..74af53d --- /dev/null +++ b/content/troubleshooting-cases/sidebars.ts @@ -0,0 +1,91 @@ +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; + +const sidebars: SidebarsConfig = { + troubleshootingSidebar: [ + 'README', + { + type: 'category', + label: '运行时排障', + collapsed: true, + link: { + type: 'generated-index', + slug: '/cases/runtime' + }, + items: [ + 'runtime/io-high-load-causing-pod-creation-timeout', + 'runtime/pull-image-fail-in-high-version-containerd', + 'runtime/mount-root-causing-device-or-resource-busy', + 'runtime/broken-system-time-causing-sandbox-conflicts', + ], + }, + { + type: 'category', + label: '网络排障', + collapsed: true, + link: { + type: 'generated-index', + slug: '/cases/network' + }, + items: [ + 'network/dns-lookup-5s-delay', + 'network/arp-cache-overflow-causing-healthcheck-failed', + 'network/cross-vpc-connect-nodeport-timeout', + 'network/musl-libc-dns-id-conflict-causing-dns-abnormal', + ], + }, + { + type: 'category', + label: '高负载', + collapsed: true, + link: { + type: 'generated-index', + slug: '/cases/high-load' + }, + items: [ + 'high-load/disk-full-causing-high-cpu', + ], + }, + { + type: 'category', + label: '集群故障', + collapsed: true, + link: { + type: 'generated-index', + slug: '/cases/cluster' + }, + items: [ + 'cluster/delete-rancher-ns-causing-node-disappear', + 'cluster/scheduler-snapshot-missing-causing-pod-pending', + 'cluster/kubectl-exec-or-logs-failed', + ], + }, + { + type: 'category', + label: '节点排障', + collapsed: true, + link: { + type: 'generated-index', + slug: '/cases/node' + }, + items: [ + 'node/cgroup-leaking', + ], + }, + { + type: 'category', + label: '其它排障', + collapsed: true, + link: { + type: 'generated-index', + slug: '/cases/others' + }, + items: [ + 'others/failed-to-modify-hosts-in-multiple-container', + 'others/job-cannot-delete', + 'others/dotnet-configuration-cannot-auto-reload', + ], + }, + ], +}; + +export default sidebars; diff --git a/content/troubleshooting/sidebars.ts b/content/troubleshooting/sidebars.ts index 277ad0a..de0e994 100644 --- a/content/troubleshooting/sidebars.ts +++ b/content/troubleshooting/sidebars.ts @@ -117,99 +117,6 @@ const sidebars: SidebarsConfig = { ], }, "sdk", - { - type: 'category', - label: '排障案例', - collapsed: false, - link: { - type: 'generated-index', - slug: '/cases' - }, - items: [ - { - type: 'category', - label: '运行时排障', - collapsed: true, - link: { - type: 'generated-index', - slug: '/cases/runtime' - }, - items: [ - 'cases/runtime/io-high-load-causing-pod-creation-timeout', - 'cases/runtime/pull-image-fail-in-high-version-containerd', - 'cases/runtime/mount-root-causing-device-or-resource-busy', - 'cases/runtime/broken-system-time-causing-sandbox-conflicts', - ], - }, - { - type: 'category', - label: '网络排障', - collapsed: true, - link: { - type: 'generated-index', - slug: '/cases/network' - }, - items: [ - 'cases/network/dns-lookup-5s-delay', - 'cases/network/arp-cache-overflow-causing-healthcheck-failed', - 'cases/network/cross-vpc-connect-nodeport-timeout', - 'cases/network/musl-libc-dns-id-conflict-causing-dns-abnormal', - ], - }, - { - type: 'category', - label: '高负载', - collapsed: true, - link: { - type: 'generated-index', - slug: '/cases/high-load' - }, - items: [ - 'cases/high-load/disk-full-causing-high-cpu', - ], - }, - { - type: 'category', - label: '集群故障', - collapsed: true, - link: { - type: 'generated-index', - slug: '/cases/cluster' - }, - items: [ - 'cases/cluster/delete-rancher-ns-causing-node-disappear', - 'cases/cluster/scheduler-snapshot-missing-causing-pod-pending', - 'cases/cluster/kubectl-exec-or-logs-failed', - ], - }, - { - type: 'category', - label: '节点排障', - collapsed: true, - link: { - type: 'generated-index', - slug: '/cases/node' - }, - items: [ - 'cases/node/cgroup-leaking', - ], - }, - { - type: 'category', - label: '其它排障', - collapsed: true, - link: { - type: 'generated-index', - slug: '/cases/others' - }, - items: [ - 'cases/others/failed-to-modify-hosts-in-multiple-container', - 'cases/others/job-cannot-delete', - 'cases/others/dotnet-configuration-cannot-auto-reload', - ], - }, - ], - } ], }; diff --git a/docusaurus.config.ts b/docusaurus.config.ts index f306726..bfa35f2 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -97,6 +97,21 @@ const config: Config = { `https://github.com/imroc/kubernetes-guide/edit/main/content/troubleshooting/${docPath}`, }), ], + [ + /** @type {import('@docusaurus/plugin-content-docs').PluginOptions} */ + '@docusaurus/plugin-content-docs', + ({ + id: 'troubleshooting-cases', + path: 'content/troubleshooting-cases', + // 文档的路由前缀 + routeBasePath: '/troubleshooting-cases', + // 左侧导航栏的配置 + sidebarPath: require.resolve('./content/troubleshooting-cases/sidebars.ts'), + // 每个文档左下角 "编辑此页" 的链接 + editUrl: ({ docPath }) => + `https://github.com/imroc/kubernetes-guide/edit/main/content/troubleshooting-cases/${docPath}`, + }), + ], [ /** @type {import('@docusaurus/plugin-content-docs').PluginOptions} */ '@docusaurus/plugin-content-docs', @@ -182,6 +197,11 @@ const config: Config = { position: 'right', to: '/troubleshooting', }, + { + label: '排障案例', + position: 'right', + to: '/troubleshooting-cases', + }, { label: '实践案例', position: 'right',