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/api-change-vks-ufyxl12t.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "api-change",
"category": "vks",
"description": "Remove get-nodegroup-events; network-type CALICO->TIGERA; --os adds rocky; replace boolean toggle flags with --private-cluster/--private-nodes/--load-balancer-plugin/--block-store-csi-plugin <enabled|disabled>"
}
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-configure-0wjocz7d.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "configure",
"description": "Fix panic (nil pointer) when running 'grn configure --profile <name>' for a profile that does not exist yet; start from empty defaults so the profile can be created"
}
5 changes: 5 additions & 0 deletions .changes/next-release/bugfix-vks-uv426h3g.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "bugfix",
"category": "vks",
"description": "Return a non-zero exit code and 'unknown command' error for invalid subcommands of grn vks/vserver (and their groups) instead of silently printing help with exit 0"
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ grn --version
**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**

Expand Down
44 changes: 18 additions & 26 deletions docs/commands/vks/create-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Create a new VKS cluster with an initial default node group. The command provisi

Cluster names must be 5–20 characters, lowercase alphanumeric and hyphens, starting and ending with an alphanumeric character. Node group names follow the same pattern with a length of 5–15 characters.

When `--network-type` is `CALICO` or `CILIUM_OVERLAY`, the `--cidr` option is required. By default, both the load balancer plugin and the block store CSI plugin are enabled; use the `--no-*` flags to disable them.
When `--network-type` is `TIGERA` or `CILIUM_OVERLAY`, the `--cidr` option is required. By default, both the load balancer plugin and the block store CSI plugin are enabled; use `--load-balancer-plugin disabled` or `--block-store-csi-plugin disabled` to turn them off.

Use `--dry-run` to validate all parameters without sending a create request.

Expand All @@ -26,15 +26,13 @@ grn vks create-cluster
--ssh-key-id <value>
[--cidr <value>]
[--description <value>]
[--enable-private-cluster]
[--private-cluster <enabled|disabled>]
[--release-channel <value>]
[--enabled-load-balancer-plugin]
[--no-load-balancer-plugin]
[--enabled-block-store-csi-plugin]
[--no-block-store-csi-plugin]
[--load-balancer-plugin <enabled|disabled>]
[--block-store-csi-plugin <enabled|disabled>]
[--disk-size <value>]
[--num-nodes <value>]
[--enable-private-nodes]
[--private-nodes <enabled|disabled>]
[--security-groups <value>]
[--labels <value>]
[--taints <value>]
Expand All @@ -52,7 +50,7 @@ grn vks create-cluster
: Kubernetes version for the cluster (e.g. `v1.29.1`).

`--network-type` (required)
: Network type for the cluster. Accepted values: `CALICO`, `CILIUM_OVERLAY`, `CILIUM_NATIVE_ROUTING`.
: Network type for the cluster. Accepted values: `TIGERA`, `CILIUM_OVERLAY`, `CILIUM_NATIVE_ROUTING`.

`--vpc-id` (required)
: VPC ID where the cluster will be provisioned.
Expand All @@ -61,28 +59,22 @@ grn vks create-cluster
: Subnet ID for the cluster control plane and the default node group.

`--cidr` (optional)
: Pod CIDR block. Required when `--network-type` is `CALICO` or `CILIUM_OVERLAY` (e.g. `10.96.0.0/12`).
: Pod CIDR block. Required when `--network-type` is `TIGERA` or `CILIUM_OVERLAY` (e.g. `10.96.0.0/12`).

`--description` (optional)
: Human-readable description for the cluster.

`--enable-private-cluster` (optional)
: Enable private cluster mode (control plane not accessible from the public internet).
`--private-cluster` (optional, default `disabled`)
: Control plane accessibility. `enabled` makes the control plane inaccessible from the public internet. Accepted values: `enabled`, `disabled`.

`--release-channel` (optional)
: Release channel for automatic upgrades. Accepted values: `RAPID`, `STABLE`. Default: `STABLE`.

`--enabled-load-balancer-plugin` (optional)
: Explicitly enable the load balancer plugin (enabled by default).
`--load-balancer-plugin` (optional, default `enabled`)
: Load balancer plugin state. Accepted values: `enabled`, `disabled`.

`--no-load-balancer-plugin` (optional)
: Disable the load balancer plugin.

`--enabled-block-store-csi-plugin` (optional)
: Explicitly enable the block store CSI plugin (enabled by default).

`--no-block-store-csi-plugin` (optional)
: Disable the block store CSI plugin.
`--block-store-csi-plugin` (optional, default `enabled`)
: Block store CSI plugin state. Accepted values: `enabled`, `disabled`.

**Node group settings**

Expand All @@ -93,7 +85,7 @@ grn vks create-cluster
: Flavor (instance type) ID for the nodes.

`--os` (optional, default `ubuntu`)
: Node group OS image. Supported values: `ubuntu`, `linux`.
: Node group OS image. Supported values: `ubuntu`, `linux`, `rocky`.

`--disk-type` (required)
: Disk type ID for the node boot volumes.
Expand All @@ -107,8 +99,8 @@ grn vks create-cluster
`--num-nodes` (optional)
: Number of nodes to create in the default node group. Accepted range: 0–10. Default: `1`.

`--enable-private-nodes` (optional)
: Enable private nodes (nodes will not have public IP addresses).
`--private-nodes` (optional, default `disabled`)
: Private nodes state. `enabled` means nodes will not have public IP addresses. Accepted values: `enabled`, `disabled`.

`--security-groups` (optional)
: Comma-separated list of security group IDs to attach to the nodes (e.g. `sg-aaa111,sg-bbb222`).
Expand Down Expand Up @@ -140,13 +132,13 @@ grn vks create-cluster \
--ssh-key-id key-abc12345-0000-0000-0000-000000000001
```

Create a cluster with CALICO network type (CIDR required):
Create a cluster with TIGERA network type (CIDR required):

```bash
grn vks create-cluster \
--name prod-cluster \
--k8s-version v1.29.1 \
--network-type CALICO \
--network-type TIGERA \
--cidr 10.96.0.0/12 \
--vpc-id net-abc12345-0000-0000-0000-000000000001 \
--subnet-id sub-abc12345-0000-0000-0000-000000000001 \
Expand Down
8 changes: 4 additions & 4 deletions docs/commands/vks/create-nodegroup.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ grn vks create-nodegroup
--flavor-id <value>
--disk-type <value>
--ssh-key-id <value>
[--enable-private-nodes]
[--private-nodes <enabled|disabled>]
[--num-nodes <value>]
[--disk-size <value>]
[--security-groups <value>]
Expand All @@ -36,7 +36,7 @@ grn vks create-nodegroup
: Node group name. Must be 5–15 characters, lowercase alphanumeric and hyphens, starting and ending with an alphanumeric character.

`--os` (optional, default `ubuntu`)
: Node group OS image. Supported values: `ubuntu`, `linux`.
: Node group OS image. Supported values: `ubuntu`, `linux`, `rocky`.

`--flavor-id` (required)
: Flavor (instance type) ID for the nodes.
Expand All @@ -47,8 +47,8 @@ grn vks create-nodegroup
`--ssh-key-id` (required)
: SSH key pair ID to inject into each node.

`--enable-private-nodes` (optional)
: Enable private nodes (nodes will not have public IP addresses).
`--private-nodes` (optional, default `disabled`)
: Private nodes state. `enabled` means nodes will not have public IP addresses. Accepted values: `enabled`, `disabled`.

`--num-nodes` (optional)
: Number of nodes to create. Accepted range: 0–10. Default: `1`.
Expand Down
59 changes: 0 additions & 59 deletions docs/commands/vks/get-nodegroup-events.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/commands/vks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ grn vks <command> [options]
| 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

Expand Down
22 changes: 7 additions & 15 deletions docs/commands/vks/update-cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ grn vks update-cluster
--cluster-id <value>
--k8s-version <value>
--whitelist-node-cidrs <value>
[--enabled-load-balancer-plugin]
[--no-load-balancer-plugin]
[--enabled-block-store-csi-plugin]
[--no-block-store-csi-plugin]
[--load-balancer-plugin <enabled|disabled>]
[--block-store-csi-plugin <enabled|disabled>]
[--dry-run]
```

Expand All @@ -31,17 +29,11 @@ grn vks update-cluster
`--whitelist-node-cidrs` (required)
: Comma-separated list of CIDRs allowed to communicate with cluster nodes. At least one value is required (e.g. `10.0.0.0/8,192.168.0.0/16`).

`--enabled-load-balancer-plugin` (optional)
: Enable the load balancer plugin.
`--load-balancer-plugin` (optional)
: Set the load balancer plugin state. When omitted, the current state is left unchanged. Accepted values: `enabled`, `disabled`.

`--no-load-balancer-plugin` (optional)
: Disable the load balancer plugin.

`--enabled-block-store-csi-plugin` (optional)
: Enable the block store CSI plugin.

`--no-block-store-csi-plugin` (optional)
: Disable the block store CSI plugin.
`--block-store-csi-plugin` (optional)
: Set the block store CSI plugin state. When omitted, the current state is left unchanged. Accepted values: `enabled`, `disabled`.

`--dry-run` (optional)
: Print the update payload without sending the request.
Expand All @@ -64,7 +56,7 @@ grn vks update-cluster \
--cluster-id cls-abc12345-6789-def0-1234-abcdef012345 \
--k8s-version v1.29.1 \
--whitelist-node-cidrs 10.0.0.0/8 \
--no-load-balancer-plugin
--load-balancer-plugin disabled
```

Preview what would be sent (dry run):
Expand Down
2 changes: 1 addition & 1 deletion docs/usage/dry-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Validates parameters offline:
- Cluster/nodegroup name format
- Disk size range (20-5000 GiB)
- Number of nodes range (0-10)
- CIDR requirement for CALICO/CILIUM_OVERLAY networks
- CIDR requirement for TIGERA/CILIUM_OVERLAY networks

### Delete dry-run

Expand Down
9 changes: 7 additions & 2 deletions go/cmd/configure/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,13 @@ func runConfigure(cmd *cobra.Command, args []string) {
profile = "default"
}

// Load existing config for defaults
cfg, _ := config.LoadConfig(profile)
// Load existing config for defaults. A new/unknown profile (or a parse error)
// yields no config — start from empty defaults so `configure` can create it
// instead of crashing on a nil dereference.
cfg, err := config.LoadConfig(profile)
if err != nil || cfg == nil {
cfg = &config.Config{}
}

reader := bufio.NewReader(os.Stdin)

Expand Down
26 changes: 15 additions & 11 deletions go/cmd/vks/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,21 @@ func fetchK8sVersions(_ context.Context, cmd *cobra.Command) ([]string, error) {

func flagCompleters() map[string]cli.CompFunc {
return map[string]cli.CompFunc{
"cluster-id": cli.FlagFromAPI(fetchClusterIDs),
"nodegroup-id": cli.FlagFromAPI(fetchNodegroupIDs),
"k8s-version": cli.FlagFromAPI(fetchK8sVersions),
"os": cli.FlagValues("ubuntu", "linux"),
"network-type": cli.FlagValues("CALICO", "CILIUM_OVERLAY", "CILIUM_NATIVE_ROUTING"),
"release-channel": cli.FlagValues("RAPID", "STABLE"),
"vpc-id": cli.ResourceCompletion("vserver:network"),
"subnet-id": cli.ResourceCompletion("vserver:subnet"),
"ssh-key-id": cli.ResourceCompletion("vserver:sshkey"),
"security-groups": cli.ResourceCompletion("vserver:secgroup"),
"disk-type": cli.ResourceCompletion("vserver:volumetype"),
"cluster-id": cli.FlagFromAPI(fetchClusterIDs),
"nodegroup-id": cli.FlagFromAPI(fetchNodegroupIDs),
"k8s-version": cli.FlagFromAPI(fetchK8sVersions),
"os": cli.FlagValues("ubuntu", "linux", "rocky"),
"network-type": cli.FlagValues("TIGERA", "CILIUM_OVERLAY", "CILIUM_NATIVE_ROUTING"),
"release-channel": cli.FlagValues("RAPID", "STABLE"),
"private-cluster": cli.FlagValues("enabled", "disabled"),
"private-nodes": cli.FlagValues("enabled", "disabled"),
"load-balancer-plugin": cli.FlagValues("enabled", "disabled"),
"block-store-csi-plugin": cli.FlagValues("enabled", "disabled"),
"vpc-id": cli.ResourceCompletion("vserver:network"),
"subnet-id": cli.ResourceCompletion("vserver:subnet"),
"ssh-key-id": cli.ResourceCompletion("vserver:sshkey"),
"security-groups": cli.ResourceCompletion("vserver:secgroup"),
"disk-type": cli.ResourceCompletion("vserver:volumetype"),
}
}

Expand Down
Loading
Loading