# Nodegroup

NodeGroup operation Skill for the edgewize nodegroup project.

- Repository: https://github.com/kubesphere/kubesphere (17074 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-07-15
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add kubesphere/kubesphere --skill nodegroup -g -a claude-code -y`
Codex: `npx skills add kubesphere/kubesphere --skill nodegroup -g -a codex -y`
Cursor: `npx skills add kubesphere/kubesphere --skill nodegroup -g -a cursor -y`
Gemini CLI: `npx skills add kubesphere/kubesphere --skill nodegroup -g -a gemini-cli -y`

## Description

NodeGroup operation Skill for the edgewize nodegroup project. Use this whenever the user wants to query, create, update, delete, bind, unbind, or troubleshoot NodeGroup resources, including node binding, namespace binding, workspace binding, and deployment/config inspection for nodegroup.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# NodeGroup Operations

## Purpose

Use this skill to perform real `nodegroup`-related operations in the `edgewize-io/nodegroup` environment.

This skill should help with:

- listing and inspecting `NodeGroup`
- creating, updating, patching, and deleting `NodeGroup`
- binding and unbinding nodes
- binding and unbinding namespaces
- binding and unbinding workspaces
- troubleshooting failed or incomplete nodegroup sync
- checking deployment config under `config/nodegroup`

Prefer using the bundled script `scripts/nodegroup_api.py` for authenticated KAPI operations. Use `kubectl` only as a verification or fallback tool when the API path is unavailable.

## Prerequisites

Use the bundled script:

- `scripts/nodegroup_api.py`

Authentication model:

- logs in against `/oauth/token`
- stores token in `~/.kubesphere_token`
- uses `KUBESPHERE_HOST`, `KUBESPHERE_USERNAME`, `KUBESPHERE_PASSWORD`, and `KUBESPHERE_TOKEN`

Setup:

```bash
cd scripts
pip install requests
export KUBESPHERE_HOST="http://<kubesphere-host>"
python nodegroup_api.py login --username admin --password <password>
```

Token helpers:

```bash
python nodegroup_api.py clear-cache
python nodegroup_api.py request GET /kapis/infra.kubesphere.io/v1alpha1/nodegroups
```

## Source of Truth

When you need to confirm how an operation works, read these files first from the nodegroup source repository root:

- `pkg/kapis/infra/v1alpha1/register.go`
- `pkg/kapis/infra/v1alpha1/handler.go`
- `pkg/kapis/infra/v1alpha1/workspace_handler.go`
- `pkg/controller/nodegroup/nodegroup_controller.go`
- `pkg/constants/constants.go`

Do not invent unsupported operations. Base the workflow on the source repository.

## Main Resources

### NodeGroup

Cluster-scoped resource.

Important fields:

- `spec.alias`
- `spec.description`
- `spec.manager`
- `status.state`

## Safe Operating Rules

The rest: https://github.com/kubesphere/kubesphere/blob/HEAD/skills/nodegroup/SKILL.md
