Skip to content

Troubleshoot Kube-OVN and remove failed nodes - #273

Merged
Nick Volynkin (NickVolynkin) merged 2 commits into
mainfrom
troubleshoot-failed-node
Jul 25, 2025
Merged

Nick Volynkin (NickVolynkin) merged 2 commits into
mainfrom
troubleshoot-failed-node

Conversation

@kvaps

@kvaps Andrei Kvapil (kvaps) commented Jul 25, 2025 •

Copy link
Copy Markdown
Member

fixes cozystack/cozystack#4

Summary by CodeRabbit

  • Documentation
    • Added troubleshooting steps for resolving Kube-OVN DaemonSet pod crashes caused by corrupted OVN databases, including cleanup instructions and example manifests.
    • Provided detailed guidance for removing a failed node from a Cozystack Kubernetes cluster, covering node removal, cleanup of local persistent volumes, and restoring replica counts.

@coderabbitai

coderabbitai Bot commented Jul 25, 2025 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

This update adds two new troubleshooting sections to the documentation. The first section addresses Kube-OVN DaemonSet pod crashes due to a corrupted OVN database, providing cleanup steps and a DaemonSet manifest. The second section details the process for removing a failed node from a Cozystack Kubernetes cluster, including manual cleanup steps and commands.

Changes

File(s) Change Summary
content/en/docs/operations/troubleshooting.md Added sections for troubleshooting Kube-OVN DaemonSet pod crashes and removing failed nodes from Cozystack clusters. Includes YAML manifests, command examples, and detailed procedural instructions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Poem

A rabbit hops through clusters bright,
Fixing pods that crash at night.
With YAML spells and cleanup cheer,
Troubles vanish, skies are clear.
Nodes may fail, but don’t despair—
With every hop, your stack’s repaired!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 91ba948 and d67060f.

📒 Files selected for processing (1)
  • content/en/docs/operations/troubleshooting.md (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch troubleshoot-failed-node

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@netlify

netlify Bot commented Jul 25, 2025 •

Copy link
Copy Markdown

✅ Deploy Preview for cozystack ready!

Name Link
🔨 Latest commit d67060f
🔍 Latest deploy log https://app.netlify.com/projects/cozystack/deploys/68835b8a4c2612000809b649
😎 Deploy Preview https://deploy-preview-273--cozystack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary of Changes

Hello Andrei Kvapil (@kvaps), I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the operational documentation by adding a new guide for configuring SeaweedFS in a multi-datacenter environment and providing detailed troubleshooting steps for common Kubernetes issues. It introduces solutions for Kube-OVN network problems and a comprehensive procedure for gracefully removing failed nodes from a cluster, including storage and etcd cleanup.

Highlights

  • New SeaweedFS Multi-DC Documentation: Added a new documentation page (content/en/docs/operations/seaweedfs-multidc.md) detailing the configuration of SeaweedFS for multi-datacenter deployments, including YAML examples for Tenant and SeaweedFS custom resources with MultiZone and Client topologies.
  • Kube-OVN Troubleshooting Guide: Introduced a new section in the content/en/docs/operations/troubleshooting.md guide (starting at line 133) providing steps to diagnose and resolve Kube-OVN crashes, specifically addressing corrupted OVN databases with a cleanup DaemonSet and associated commands.
  • Failed Kubernetes Node Removal: Added a comprehensive guide in content/en/docs/operations/troubleshooting.md (starting at line 233) for safely removing failed Kubernetes nodes. This includes steps for kubectl delete node, etcd member cleanup for control-plane nodes, and manual cleanup of bound PVCs and pending pods using kubectl and jq/awk commands.
  • LINSTOR Resource Recovery: Included instructions within the failed node removal guide on using linstor advise resource to identify and resolve LINSTOR storage replica issues after node failures, along with commands to restore desired replica counts.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments or fill out our survey to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@kvaps Andrei Kvapil (kvaps) changed the title troubleshoot failed node Troubleshoot Kube-OVN and remove failed nodes Jul 25, 2025

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation for troubleshooting a failed node and a new page for SeaweedFS multi-DC configuration. The SeaweedFS documentation has a minor typo in an example hostname. The troubleshooting guide has an incomplete sentence, inconsistent markdown heading levels, a potentially dangerous command that could delete unrelated pods, and a Kubernetes manifest for a cleanup DaemonSet that seems to have a logic issue in its scheduling rules.

@kvaps
Andrei Kvapil (kvaps) force-pushed the troubleshoot-failed-node branch 2 times, most recently from 1a8bc47 to 91ba948 Compare July 25, 2025 09:26

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (4)
content/en/docs/operations/troubleshooting.md (4)

138-144: Add a language specifier to the fenced block

markdownlint flags this block (# kubectl get pod …) because it lacks a language tag.
Use bash so syntax highlighting works and the linter passes.

-``` 
+# ```bash

146-161: Missing language on the log excerpt block

Same MD040 violation as above. The block only shows raw log lines, so text is sufficient.

-```
+# ```text

241-241: Heading level jumps from H2 to H4

Markdown guideline MD001: increment levels one at a time. Change #### to ### (and subsequent step headings likewise).


245-248: Add language specifier to code block

The kubectl delete node example should declare bash.

-```
+# ```bash
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec6bf1a and 91ba948.

📒 Files selected for processing (1)
  • content/en/docs/operations/troubleshooting.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
content/en/docs/operations/troubleshooting.md

138-138: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


146-146: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


241-241: Heading levels should only increment by one level at a time
Expected: h3; Actual: h4

(MD001, heading-increment)


245-245: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


257-257: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (1)
content/en/docs/operations/troubleshooting.md (1)

277-284: Quoting & safety for generated delete commands

| sh -x will execute whatever jq prints; if a claimRef is missing .namespace or .name this will expand to an empty token and raise errors.
Consider guarding with -r select(.claimRef) … or removing the automatic pipe-to-shell and asking users to review first.
At minimum document the risk.

Comment thread content/en/docs/operations/troubleshooting.md Outdated
containers:
- name: cleanup
image: busybox
command: ["/bin/sh", "-xc", "rm -rf /host-config-ovn/*; rm -rf /host-config-ovn/.*; exec sleep infinity"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

rm -rf /host-config-ovn/.* tries to delete . and ..

The glob .* expands to . and .., producing noisy “cannot remove” errors.
Use a safer pattern that excludes them:

-command: ["/bin/sh", "-xc", "rm -rf /host-config-ovn/*; rm -rf /host-config-ovn/.*; exec sleep infinity"]
+command: ["/bin/sh", "-xc", "rm -rf /host-config-ovn/* /host-config-ovn/.[!.]* /host-config-ovn/..?*; exec sleep infinity"]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
command: ["/bin/sh", "-xc", "rm -rf /host-config-ovn/*; rm -rf /host-config-ovn/.*; exec sleep infinity"]
command: ["/bin/sh", "-xc", "rm -rf /host-config-ovn/* /host-config-ovn/.[!.]* /host-config-ovn/..?*; exec sleep infinity"]
🤖 Prompt for AI Agents
In content/en/docs/operations/troubleshooting.md at line 195, the command uses
the glob pattern 'rm -rf /host-config-ovn/.*' which attempts to delete '.' and
'..' directories, causing errors. Replace this pattern with a safer one that
excludes '.' and '..', such as using a pattern like '/host-config-ovn/.[!.]*' or
another method that avoids matching these special directories to prevent the
noisy errors.

Comment on lines +226 to +234
kubectl delete ds
kubectl get pod -n cozy-kubeovn
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

kubectl delete ds without arguments is hazardous

Running kubectl delete ds deletes all DaemonSets in the current namespace.
Specify the name and namespace explicitly, e.g.:

-kubectl delete ds
+kubectl delete ds ovn-cleanup -n cozy-kubeovn
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
kubectl delete ds
kubectl get pod -n cozy-kubeovn
```
kubectl delete ds ovn-cleanup -n cozy-kubeovn
kubectl get pod -n cozy-kubeovn
🤖 Prompt for AI Agents
In content/en/docs/operations/troubleshooting.md around lines 226 to 228, the
command `kubectl delete ds` is used without specifying a DaemonSet name or
namespace, which can delete all DaemonSets in the current namespace
unintentionally. Update the example to include the DaemonSet name and namespace
explicitly, such as `kubectl delete ds <daemonset-name> -n <namespace>`, to
prevent accidental mass deletion.

```

To resolve this issue, you can clean up the OVN database. This involves running a DaemonSet that removes the OVN configuration files from each node.
It is safe to perform this cleanup — the Kube-OVN DaemonSet will automatically recreate the necessary files from the Kubernetes A

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Andrei Kvapil (@kvaps) "from the Kubernetes A..."?

Kubernetes API?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NickVolynkin
Nick Volynkin (NickVolynkin) deleted the troubleshoot-failed-node branch July 25, 2025 10:25
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.

Add kube-ovn troubleshooting guide

2 participants