Skip to content

feat(skills): add openyurt-raven, raven-topology, and yurthub-autonomy skills - #2592

Open
Aryanbhargava18 wants to merge 1 commit into
openyurtio:masterfrom
Aryanbhargava18:feature/claude-deploy-skill
Open

Aryanbhargava18 wants to merge 1 commit into
openyurtio:masterfrom
Aryanbhargava18:feature/claude-deploy-skill

Conversation

@Aryanbhargava18

@Aryanbhargava18 Aryanbhargava18 commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind documentation
/sig ai

What this PR does / why we need it:

Adds the follow-up Claude Code skills planned in .claude/skills/README.md on top of #2844 (openyurt-deploy):

  1. openyurt-raven (.claude/skills/openyurt-raven/): Configures Raven cross-NodePool L3 VPN tunneling and L7 proxying via the openyurtio/raven raven-agent chart (DaemonSet/raven-agent-ds, Secret/raven-agent-secret, ConfigMap/raven-cfg) and Gateway (raven.openyurt.io/v1beta1) CRs, including SetDefaultsGateway alignment, non-SSH ephemeral Job checks (busybox:1.36.1), and in-memory cross-NodePool connectivity verification.
  2. raven-topology (.claude/skills/raven-topology/): Read-only diagnostic workflow for kube-system/raven-cfg, Gateway active endpoint election in yurt-manager, raven-agent-ds (app=raven-agent), x-raven-proxy-internal-svc, and edge-tunnel-nodes.
  3. yurthub-autonomy (.claude/skills/yurthub-autonomy/): Read-only diagnostic workflow for node.openyurt.io/autonomy-duration, PodBindingController pod toleration rewrites, deprecated node.beta.openyurt.io/autonomy, and YurtHub disk cache paths (/etc/kubernetes/cache/, /var/lib/yurthub).

Updates .claude/skills/README.md to index all three skills and remove openyurt-raven from the pending list. All code, chart, and build-script changes from earlier iterations were dropped so this PR touches only .claude/skills/.

Which issue(s) this PR fixes:

Part of #2559

Special notes for your reviewer:

Rebased cleanly onto master (#2844 and #2675 already merged). Verified every referenced annotation, ConfigMap/Secret name, DaemonSet/label, and v1beta1.Gateway field against OpenYurt master and openyurtio/raven charts/raven-agent.

Does this PR introduce a user-facing change?

NONE

@Aryanbhargava18
Aryanbhargava18 marked this pull request as ready for review July 17, 2026 19:18
@Aryanbhargava18
Aryanbhargava18 requested a review from a team as a code owner July 17, 2026 19:18
@Aryanbhargava18

Aryanbhargava18 commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Hey @rambohe-ch @zyjhtangtang @luc99hen! I saw Issue #2559 on the CNCF Mentoring board. Since I heavily utilize Markdown-based AI coding assistants in my day-to-day Kubernetes workflows, I wanted to proactively lay out the foundational architecture for the OpenYurt skills before the application period officially opens.

I read through the issue discussion thread and noted the team's strong preference for a modular, maintainable folder structure (keeping the entrypoint short and moving detailed logic to reference files). I've implemented exactly that architecture here for both the deploy and raven skills.

Key Technical Implementations in this Draft:

  • Modular Architecture: Split /openyurt-deploy and /openyurt-raven into SKILL.md (frontmatter restrictions) and a references/ directory containing the flow, troubleshooting, and uninstall decision trees.
  • crictl Diagnostic Loop: Noticed the hard dependency on crictl for the node-servant Job. I built an explicit diagnostic branch in the troubleshooting reference to catch this failure and instruct the AI how to resolve it dynamically without halting the user.
  • Stable Verification: Bypassed the non-existent Autonomy condition in favor of instructing the AI to poll the isConvertedStable() requirements directly via node labels and the YurtConversionFailed condition.

I opened this as a Draft PR so we can iterate on the structure. Let me know your thoughts on the modular references approach!

@ADITYA-CODE-SOURCE ADITYA-CODE-SOURCE left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for putting this together — the modular SKILL.md + references/ split looks good.

I checked this against current source and noticed two correctness issues that seem worth aligning before merge:

  1. The conversion condition is YurtNodeConversionFailed, and success can’t be checked as just “absent or False” because Converting is also False.
  2. node.openyurt.io/autonomy-duration is currently an annotation, not a node label.

Optional follow-up: the Raven Gateway example may also need a pass against the current v1beta1 schema.

Could we align these with current source behavior?

@Aryanbhargava18

Aryanbhargava18 commented Jul 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for pointing those out @ADITYA-CODE-SOURCE. Good catches on the controller contract and the annotation semantics.

I've pushed a commit addressing them:

  1. Conversion Controller Align: Updated the deployment flow to check that the node is uncordoned and YurtNodeConversionFailed condition is False with reason Converted.
  2. Autonomy Annotation: Changed kubectl label to kubectl annotate to match pkg/projectinfo/projectinfo.go.
  3. Raven v1beta1 Schema: Also updated the Gateway CR in the Raven flow to use the v1beta1 exposeType, tunnelConfig, and proxyConfig fields.

@Aryanbhargava18

Copy link
Copy Markdown
Contributor Author

Good catch @ADITYA-CODE-SOURCE. Since v1beta1.SetDefaultsGateway unconditionally sets spec.nodeSelector to raven.openyurt.io/gateway: <gateway-name>, relying on nodeSelectorTerms for apps.openyurt.io/nodepool would indeed be misleading as the mutating webhook would silently overwrite it.

I just pushed a commit that updates the openyurt-raven-flow.md to explicitly use the LabelSelector shape with raven.openyurt.io/gateway to match the defaulting behavior. I also added a step to proactively label the nodes in the nodepool with raven.openyurt.io/gateway=<NODEPOOL_NAME>-gw so they successfully join the gateway.

Thanks again for reviewing!

@Aryanbhargava18 Aryanbhargava18 changed the title feat: Architect modular Claude Code Skills for Edge Deployment (#2559) feat: Architect modular Claude Code Skills for Edge Deployment Jul 19, 2026
@Aryanbhargava18

Copy link
Copy Markdown
Contributor Author

update: went through the latest node-servant flow again and noticed that the crictl preflight check we added also handles the edge case where containerd socket path differs between kubeadm and k3s setups. the troubleshooting reference now covers both paths so the AI skill can recover dynamically regardless of the node runtime.

@Aryanbhargava18

Aryanbhargava18 commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor Author

update: pushed a commit that embeds autonomous execution scripts directly into the markdown to replace manual instructions.

  • raven connectivity: /openyurt-raven now extracts pod IPs via JSONPath and executes cross-region ping validation to verify L3 tunnel health without human intervention.
  • diagnostics: converted /openyurt-deploy troubleshooting into an executable script. the agent now parses failed conversion jobs and catches CRI path errors (crictl) directly from pod logs.

leaving this here for review when bandwidth allows.

@Suyog241005

Copy link
Copy Markdown

I actually mapped these exact edge cases into the allowed-tools flow in #2592 a few days ago. Claude now runs a preflight LookPath("crictl") check via SSH, and polls kubectl get node to verify the is-edge-worker=true and YurtConversionFailed=False conditions.

In typical edge computing environments (which OpenYurt targets), edge nodes are located in remote NodePools behind firewalls or NATs. This means the operator's workstation running Claude Code will not have direct SSH routing to the edge nodes. Additionally, passing SSH credentials to an AI assistant raises security/compliance concerns.

Instead of SSH, we can perform this preflight check in a Kubernetes-native way:

  1. Use a light validation DaemonSet/Job: Run a temporary single-pod Job pinned to the target node using nodeSelector. The pod runs a simple script to check for crictl on the host (e.g., mounting /usr/bin or checking via a hostPath mount if appropriate) and reports back.
  2. Handle it inside YurtNodeConversionController: The best place for this check is actually inside the node conversion job or controller itself, bubbling the failure up as a standard Kubernetes Event or NodeCondition, which Claude can then easily query via kubectl.

This keeps the security boundary strictly within kubectl and helm, eliminating the need for ssh in allowed-tools.

@Suyog241005

Copy link
Copy Markdown

Hi @Aryanbhargava18,

It is great to see the pivot in Step 1.5 to use a Kubernetes-native preflight Job!

However, looking at the rest of the updated files, the dependency on SSH is still prevalent in several critical sections, which means Bash(ssh *), Bash(systemctl *), and Bash(journalctl *) are still required in SKILL.md:

  1. Deploy Troubleshooting: SSH commands are still used to install cri-tools, read /etc/kubernetes/kubelet.conf, and check containerd sockets.
  2. Deploy Uninstall: SSH is used to manually clean up static pod manifests from the node filesystem.
  3. Raven Flow & Troubleshooting: SSH is used to check for libreswan (ipsec --version) and install packages on the gateways.

If the user's workstation cannot SSH into edge nodes due to firewalls or NAT, all of these troubleshooting and uninstall steps will fail when Claude attempts to run them.

To make this base framework production-grade, we should replace these remaining SSH instructions:

  • Manifest clean-up: Instead of deleting files via SSH, we can use a privileged daemonset/job to run the file deletion natively, or document it as a manual operator step outside of Claude's automated capabilities.
  • Verification / Diagnosis: We can package containerd socket checks and IPsec checks into standard Kubernetes-native jobs/pods similar to the one implemented in Step 1.5.

This will allow us to safely strip ssh, systemctl, and journalctl entirely from allowed-tools.

Comment thread .claude/skills/openyurt-deploy/SKILL.md Resolved
@Aryanbhargava18
Aryanbhargava18 force-pushed the feature/claude-deploy-skill branch from 9811827 to 85e3b2d Compare July 20, 2026 09:57
@Aryanbhargava18

Aryanbhargava18 commented Jul 20, 2026 •

Copy link
Copy Markdown
Contributor Author

@Suyog241005 You are absolutely right—relying on SSH from a workstation to a remote edge node behind NAT breaks the OpenYurt cloud-edge tunnel model. Expanding the AI's footprint with SSH credentials is an unnecessary risk.

Great architectural catch.

I just pushed a two-part fix replacing the SSH approach with exactly what you suggested: lightweight, ephemeral Kubernetes Jobs and DaemonSets pinned to the target node.

Commit 208f129: Replaced the Preflight SSH check with a native Job that verifies the crictl binary and CRI sockets via host mounts.
Commit 9811827: Eradicated every remaining SSH dependency across the troubleshooting, uninstall, and Raven references using the exact same native execution pattern.

The security boundary is now strictly contained to kubectl and helm. ssh has been completely stripped from allowed-tools across the entire codebase.

Thank you again for the incredibly sharp review on the edge networking constraints, @Suyog241005. It made the architecture significantly stronger.

@Suyog241005

Copy link
Copy Markdown

Hi @Aryanbhargava18,

This is a fantastic update!

I just reviewed the latest changes. The transition to Kubernetes-native verification Jobs, the use of a privileged cleanup DaemonSet for host manifests, and the complete elimination of /tmp writes for the Raven test make this skill set extremely secure, robust, and compatible with edge topologies behind NATs/firewalls.

Removing ssh, systemctl, and journalctl from allowed-tools ensures that the AI assistant's execution boundary is strictly limited to the Kubernetes API (kubectl and helm). This is a huge win for security.

Since this base framework is now in a solid, merge-ready state, I would love to collaborate on the next phase. I can take ownership of implementing the /openyurt-service-topology skill or help with the validation/testing of this deploy/raven flow.

Let me know what you think is the best way to split the remaining scope!

@Aryanbhargava18

Copy link
Copy Markdown
Contributor Author

@Suyog241005 Thanks for the thorough review — the push toward a fully Kubernetes-native execution boundary genuinely strengthened this framework.

Regarding collaboration: since this PR establishes the core deploy/raven foundation, my focus is on getting it reviewed and aligned with the maintainers first. For the service topology skill, I'd recommend opening a separate PR and adopting the same SKILL.md + references/ architecture and kubectl/helm-only allowed-tools constraints we solidified here — that way the skills stay consistent across the repo.

Happy to review your execution models once you have something drafted.

@Aryanbhargava18

Copy link
Copy Markdown
Contributor Author

@zyjhtangtang Thanks for getting the webhook fix merged! I've just rebased this architecture PR on top of latest master so it includes those new NodeSelector rules. The deployment workflows are fully unblocked and ready for your final review whenever you have the bandwidth.

@codecov

codecov Bot commented Jul 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 47.20%. Comparing base (4840e2d) to head (da105f9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2592   +/-   ##
=======================================
  Coverage   47.20%   47.20%           
=======================================
  Files         405      405           
  Lines       27685    27685           
=======================================
+ Hits        13068    13069    +1     
+ Misses      13440    13438    -2     
- Partials     1177     1178    +1     
Flag Coverage Δ
unittests 47.20% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Aryanbhargava18
Aryanbhargava18 force-pushed the feature/claude-deploy-skill branch 2 times, most recently from 37605ce to d013ddb Compare July 21, 2026 08:15
@Aryanbhargava18

Aryanbhargava18 commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor Author

update: flushed out the logic for the two core skills:

  1. raven topology: debugs cross-region L3/L7 routing via gateway and ipsec tunnel inspection.
  2. yurthub autonomy: verifies edge node autonomy annotations and local cache integrity during cloud disconnections.

architecture is stable.

@Aryanbhargava18
Aryanbhargava18 force-pushed the feature/claude-deploy-skill branch from 47274fd to 1cc7161 Compare July 22, 2026 01:07
@alokkumardalei-wq

Copy link
Copy Markdown
Contributor

hey @Aryanbhargava18 i was checking issue 2559 and came here to review the new .claude/skills structure. noticed two things:

  • in openyurt-deploy/SKILL.md , it still says preflight checks run "via SSH". didn't you mention completely ripping out SSH for ephemeral jobs? you probably want to update the docs so claude doesn't try to use ssh by mistake.
  • it looks like you accidentally pulled in commits from another branch or messed up a rebase. the branch has over 2,200 lines of unrelated go code changes from other people.

can you remove the unnecessary commits so we can cleanly review the preflight logic 😊.

@Aryanbhargava18
Aryanbhargava18 force-pushed the feature/claude-deploy-skill branch from 1cc7161 to 944f949 Compare July 23, 2026 12:30
@Aryanbhargava18

Copy link
Copy Markdown
Contributor Author

Thanks for catching that, @alokkumardalei-wq! Good eye.

  1. I've updated the SKILL.md file to completely remove the outdated SSH references. The documentation now correctly reflects the Kubernetes-native ephemeral Job execution model.
  2. Apologies for the noise! I had a botched local rebase that inadvertently pulled in some rewritten upstream commits. I've sliced those out and force-pushed a clean history. The PR diff is back to normal now.

Let me know if you spot anything else during your review!

@Aryanbhargava18

Aryanbhargava18 commented Jul 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@Suyog241005 ssh dependencies have been fully replaced with k8s-native jobs. feel free to resolve the requested changes to unblock the checks.

architecture is stable and ready.

@Aryanbhargava18
Aryanbhargava18 force-pushed the feature/claude-deploy-skill branch from 944f949 to 9624edc Compare August 18, 2026 11:12
@sonarqubecloud

Copy link
Copy Markdown

@Aryanbhargava18

Copy link
Copy Markdown
Contributor Author

Updated .claude/skills/README.md in 2e486fde so it matches the refactored skills (ephemeral Kubernetes Job preflight for crictl and YurtNodeConversionFailed=False/Converted). All prior review points from @ADITYA-CODE-SOURCE and @Suyog241005 (moving to .claude/skills/, removing Bash(ssh *), using an ephemeral k8s Job instead of SSH, keeping raven-test pod metadata in memory instead of /tmp, and using LabelSelector / YurtNodeConversionFailed / node.openyurt.io/autonomy-duration annotation) are addressed. Could @Suyog241005 please take another look when convenient?

…y skills

Signed-off-by: Aryanbhargava18 <aryanbhargava644@gmail.com>
@Aryanbhargava18
Aryanbhargava18 force-pushed the feature/claude-deploy-skill branch from 2e486fd to da105f9 Compare November 25, 2026 00:18
@Aryanbhargava18 Aryanbhargava18 changed the title feat: Architect modular Claude Code Skills for Edge Deployment feat(skills): add openyurt-raven, raven-topology, and yurthub-autonomy skills Nov 25, 2026
@Aryanbhargava18

Copy link
Copy Markdown
Contributor Author

Rebased onto master (commit da105f95) after #2844 and #2675 landed:

  • Dropped the already-merged openyurt-deploy, .gitignore, and hack/make-rules/* diffs plus unrelated pkg/node-servant edits so the PR cleanly adds only .claude/skills/ follow-ups.
  • Updated .claude/skills/README.md to index openyurt-raven, raven-topology, and yurthub-autonomy.
  • Aligned all three skills with OpenYurt master and openyurtio/raven charts/raven-agent (raven-cfg, raven-agent-ds / app=raven-agent, raven-agent-secret, yurt-manager controllers, and node.openyurt.io/autonomy-duration), keeping explicit --context <CTX> and change-card safety rules matching openyurt-deploy.

@sonarqubecloud

Copy link
Copy Markdown

@Aryanbhargava18

Copy link
Copy Markdown
Contributor Author

Resolved the review threads now that the rebase onto master (da105f95) dropped the already-merged openyurt-deploy / .claude/commands diffs and kept the updated .claude/skills/ docs (ephemeral crictl Job, in-memory PODS variable, and schema alignment), with SonarQube and all CI checks passing.

@Suyog241005 @ADITYA-CODE-SOURCE could you take another look and re-review when you have a moment to clear the change request? Thanks!

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.

4 participants