Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/next-release/feature-vks-03mnp7ol.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "feature",
"category": "vks",
"description": "Add kubeconfig commands (generate-kubeconfig, update-kubeconfig) for VKS clusters"
}
5 changes: 5 additions & 0 deletions .changes/next-release/feature-vks-m484unqd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "feature",
"category": "vks",
"description": "Add list-cluster-versions, get-cluster-events, and get-nodegroup-events commands"
}
5 changes: 5 additions & 0 deletions .changes/next-release/feature-vks-odbam6zb.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "feature",
"category": "vks",
"description": "Add upgrade-nodegroup-version, config-auto-healing, and update-nodegroup-metadata commands"
}
10 changes: 10 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ go/
│ ├── get_nodegroup.go
│ ├── create_nodegroup.go
│ ├── update_nodegroup.go
│ ├── update_nodegroup_metadata.go # Update labels/tags/taints
│ ├── upgrade_nodegroup_version.go # Upgrade node group k8s version
│ ├── delete_nodegroup.go
│ ├── list_cluster_versions.go # Available k8s versions
│ ├── config_auto_healing.go # Configure auto-healing
│ ├── get_cluster_events.go # Cluster events (paginated)
│ ├── get_nodegroup_events.go # Node group events (paginated)
│ ├── generate_kubeconfig.go # Request kubeconfig (async)
│ ├── update_kubeconfig.go # Fetch + merge kubeconfig
│ ├── wait_cluster_active.go # Polling waiter
│ └── auto_upgrade.go # Set/delete auto-upgrade
├── internal/
Expand All @@ -43,6 +51,8 @@ go/
│ ├── auth/token.go # OAuth2 Client Credentials (IAM)
│ ├── client/client.go # HTTP client with retry + auto-refresh
│ ├── formatter/formatter.go # JSON/Table/Text + JMESPath
│ ├── kubeconfig/
│ │ └── kubeconfig.go # Merge kubeconfig into ~/.kube/config
│ └── validator/validator.go # ID format validation
├── go.mod, go.sum
```
Expand Down
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,57 @@ To check the version:
grn --version
```

### Available VKS Commands

**Cluster**

- `list-clusters` — List all VKS clusters
- `get-cluster` — Get cluster details
- `create-cluster` — Create a new VKS cluster
- `update-cluster` — Update a VKS cluster
- `delete-cluster` — Delete a VKS cluster

**Node Group**

- `list-nodegroups` — List node groups for a cluster
- `get-nodegroup` — Get node group details
- `create-nodegroup` — Create a new node group
- `update-nodegroup` — Update a node group
- `update-nodegroup-metadata` — Update labels, tags, and taints of a node group
- `upgrade-nodegroup-version` — Upgrade the Kubernetes version of a node group
- `delete-nodegroup` — Delete a node group

**Versions**

- `list-cluster-versions` — List available Kubernetes versions

**Auto-Upgrade**

- `set-auto-upgrade-config` — Configure auto-upgrade schedule for a cluster
- `delete-auto-upgrade-config` — Delete auto-upgrade config for a cluster

**Auto-Healing**

- `config-auto-healing` — Configure auto-healing for a cluster

**Events**

- `get-cluster-events` — Get the list of events for a cluster
- `get-nodegroup-events` — Get the list of events for a node group

**Kubeconfig**

- `generate-kubeconfig` — Request generation of a cluster kubeconfig
- `update-kubeconfig` — Fetch and merge the cluster kubeconfig into your kubeconfig file

**Quota**

- `get-quota` — Get VKS quota limits and current usage

**Waiter**

- `wait-cluster-active` — Wait until a cluster reaches ACTIVE status

## Getting Help

The best way to interact with our team is through GitHub:
Expand Down
61 changes: 61 additions & 0 deletions docs/commands/vks/config-auto-healing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# config-auto-healing

## Description

Configure auto-healing for a VKS cluster. Auto-healing automatically replaces unhealthy nodes to keep the cluster in a working state.

## Synopsis

```
grn vks config-auto-healing
--cluster-id <value>
--enable-auto-healing
[--max-unhealthy <value>]
[--unhealthy-range <value>]
[--timeout-unhealthy <value>]
```

## Options

`--cluster-id` (required)
: The ID of the cluster.

`--enable-auto-healing` (required)
: Whether to enable auto-healing. Pass `--enable-auto-healing` to enable, or `--enable-auto-healing=false` to disable.

`--max-unhealthy` (optional)
: Maximum number (or percentage) of unhealthy nodes tolerated, e.g. `30%`.

`--unhealthy-range` (optional)
: The unhealthy range threshold.

`--timeout-unhealthy` (optional)
: Time in seconds a node may stay unhealthy before it is replaced.

## Examples

Enable auto-healing with default thresholds:

```bash
grn vks config-auto-healing \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345 \
--enable-auto-healing
```

Enable auto-healing with custom thresholds:

```bash
grn vks config-auto-healing \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345 \
--enable-auto-healing \
--max-unhealthy 30% \
--timeout-unhealthy 300
```

Disable auto-healing:

```bash
grn vks config-auto-healing \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345 \
--enable-auto-healing=false
```
44 changes: 44 additions & 0 deletions docs/commands/vks/generate-kubeconfig.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# generate-kubeconfig

## Description

Request the VKS API to generate (or renew) a kubeconfig for a cluster.

This operation is **asynchronous**: the server accepts the request (HTTP 202) and generates the kubeconfig in the background. Once the kubeconfig becomes `ACTIVE`, run `grn vks update-kubeconfig` to fetch it and merge it into your local kubeconfig file.

## Synopsis

```
grn vks generate-kubeconfig
--cluster-id <value>
[--expiration-days <value>]
```

## Options

`--cluster-id` (required)
: The ID of the cluster.

`--expiration-days` (optional)
: Number of days until the generated kubeconfig expires. Default: `30`.

## Examples

Request a kubeconfig with the default 30-day expiration:

```bash
grn vks generate-kubeconfig \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345
```

Request a kubeconfig with a custom expiration, then fetch it once it is active:

```bash
grn vks generate-kubeconfig \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345 \
--expiration-days 90

# Once the kubeconfig is ACTIVE:
grn vks update-kubeconfig \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345
```
53 changes: 53 additions & 0 deletions docs/commands/vks/get-cluster-events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# get-cluster-events

## Description

Get the list of events for a VKS cluster. Events can be filtered by action and type, and the results are paginated.

## Synopsis

```
grn vks get-cluster-events
--cluster-id <value>
[--action <value>]
[--type <value>]
[--page <value>]
[--page-size <value>]
```

## Options

`--cluster-id` (required)
: The ID of the cluster.

`--action` (optional)
: Filter events by action.

`--type` (optional)
: Filter events by event type.

`--page` (optional)
: Page number to retrieve. Pagination is 0-based (page 0 is the first page). Default: `0`.

`--page-size` (optional)
: Number of events per page. Default: `50`.

## Examples

Get the first page of cluster events:

```bash
grn vks get-cluster-events \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345
```

Filter events by action and type with a custom page size:

```bash
grn vks get-cluster-events \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345 \
--action UPGRADE \
--type INFO \
--page 0 \
--page-size 20
```
59 changes: 59 additions & 0 deletions docs/commands/vks/get-nodegroup-events.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# get-nodegroup-events

## Description

Get the list of events for a node group. Events can be filtered by action and type, and the results are paginated.

## Synopsis

```
grn vks get-nodegroup-events
--cluster-id <value>
--nodegroup-id <value>
[--action <value>]
[--type <value>]
[--page <value>]
[--page-size <value>]
```

## Options

`--cluster-id` (required)
: The ID of the cluster.

`--nodegroup-id` (required)
: The ID of the node group.

`--action` (optional)
: Filter events by action.

`--type` (optional)
: Filter events by event type.

`--page` (optional)
: Page number to retrieve. Pagination is 0-based (page 0 is the first page). Default: `0`.

`--page-size` (optional)
: Number of events per page. Default: `50`.

## Examples

Get the first page of node group events:

```bash
grn vks get-nodegroup-events \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345 \
--nodegroup-id ng-abc12345-6789-def0-1234-abcdef012345
```

Filter events by action and type with a custom page size:

```bash
grn vks get-nodegroup-events \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345 \
--nodegroup-id ng-abc12345-6789-def0-1234-abcdef012345 \
--action SCALE \
--type INFO \
--page 0 \
--page-size 20
```
28 changes: 28 additions & 0 deletions docs/commands/vks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,43 @@ grn vks <command> [options]
| [get-nodegroup](get-nodegroup.md) | Get node group details |
| [create-nodegroup](create-nodegroup.md) | Create a new node group |
| [update-nodegroup](update-nodegroup.md) | Update a node group |
| [update-nodegroup-metadata](update-nodegroup-metadata.md) | Update labels, tags, and taints of a node group |
| [upgrade-nodegroup-version](upgrade-nodegroup-version.md) | Upgrade the Kubernetes version of a node group |
| [delete-nodegroup](delete-nodegroup.md) | Delete a node group |

### Versions

| Command | Description |
|---------|-------------|
| [list-cluster-versions](list-cluster-versions.md) | List available Kubernetes versions |

### Auto-Upgrade

| Command | Description |
|---------|-------------|
| [set-auto-upgrade-config](set-auto-upgrade-config.md) | Configure auto-upgrade schedule for a cluster |
| [delete-auto-upgrade-config](delete-auto-upgrade-config.md) | Delete auto-upgrade config for a cluster |

### Auto-Healing

| Command | Description |
|---------|-------------|
| [config-auto-healing](config-auto-healing.md) | Configure auto-healing for a cluster |

### Events

| Command | Description |
|---------|-------------|
| [get-cluster-events](get-cluster-events.md) | Get the list of events for a cluster |
| [get-nodegroup-events](get-nodegroup-events.md) | Get the list of events for a node group |

### Kubeconfig

| Command | Description |
|---------|-------------|
| [generate-kubeconfig](generate-kubeconfig.md) | Request generation of a cluster kubeconfig |
| [update-kubeconfig](update-kubeconfig.md) | Fetch and merge the cluster kubeconfig into your kubeconfig file |

### Quota

| Command | Description |
Expand Down
23 changes: 23 additions & 0 deletions docs/commands/vks/list-cluster-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# list-cluster-versions

## Description

List the Kubernetes versions available for VKS clusters. Use this to discover valid version strings before upgrading a cluster or node group.

## Synopsis

```
grn vks list-cluster-versions
```

## Options

This command takes no options.

## Examples

List available Kubernetes versions:

```bash
grn vks list-cluster-versions
```
Loading
Loading