Skip to content
10 changes: 5 additions & 5 deletions .github/prompts/refactor.prompt.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
You are an expert Go developer tasked with refactoring a Go codebase. Apply systematic, incremental improvements using a top-down approach (Module -> File -> Function) while preserving all existing behavior.
You are an expert Go developer tasked with refactoring a Go codebase. Apply systematic, incremental improvements using a top-down approach (Module -> File -> Function) while preserving all existing behavior. Be thorough, and **DO NOT** stop until the codebase is totally clean.

## Workflow

1. **Load** — Load skills and relevant context
1. **Analyze** — Use `search` and `read` to understand the codebase structure before making changes
2. **Plan** — Create a prioritized todo list using `todo`, focusing on high-impact refactors first
3. **Execute** — Make one safe change at a time
4. **Validate** — Run `go test ./...` after each change; if tests fail, fix immediately before proceeding
5. **Polish** — Run `golangci-lint run --fix`, `jscpd --config .jscpd.json` and `go test ./...` to resolve any remaining issues
1. **Plan** — Create a prioritized todo list using `todo`, focusing on high-impact refactors first
1. **Execute** — Make one safe change at a time
1. **Validate** — Run `go test ./...` after each change; if tests fail, fix immediately before proceeding
1. **Polish** — Run `golangci-lint run --fix`, `jscpd --config .jscpd.json` and `go test ./...` to resolve any remaining issues

Repeat steps 1-5 until the codebase is clean, has high cohesion, low coupling, and adheres to Go best practices.
1 change: 1 addition & 0 deletions docs/src/content/docs/cli-flags/cluster/cluster-root.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Available Commands:
list List clusters
start Start a stopped cluster
stop Stop a running cluster
update Update a cluster configuration

Flags:
-h, --help help for cluster
Expand Down
53 changes: 53 additions & 0 deletions docs/src/content/docs/cli-flags/cluster/cluster-update.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: "ksail cluster update"
description: "Update a Kubernetes cluster to match the current configuration."
---

{/* This page is auto-generated by .github/scripts/generate-cli-flags-docs.sh */}

```text
Update a Kubernetes cluster to match the current configuration.

This command applies changes from your ksail.yaml configuration to a running cluster.

For Talos clusters, many configuration changes can be applied in-place without
cluster recreation (e.g., network settings, kubelet config, registry mirrors).

For Kind/K3d clusters, in-place updates are more limited. Worker node scaling
is supported for K3d, but most other changes require cluster recreation.

Changes are classified into three categories:
- In-Place: Applied without disruption
- Reboot-Required: Applied but may require node reboots
- Recreate-Required: Require full cluster recreation

Use --dry-run to preview changes without applying them.

Usage:
ksail cluster update [flags]

Flags:
--cert-manager CertManager Cert-Manager configuration (Enabled: install, Disabled: skip)
--cni CNI Container Network Interface (CNI) to use
-c, --context string Kubernetes context of cluster
--control-planes int32 Number of control-plane nodes (default 1)
--csi CSI Container Storage Interface (Default: use distribution, Enabled: install CSI, Disabled: skip CSI)
-d, --distribution Distribution Kubernetes distribution to use
--distribution-config string Configuration file for the distribution
--dry-run Preview changes without applying them
--force Skip confirmation prompt and proceed with cluster recreation
-g, --gitops-engine GitOpsEngine GitOps engine to use (None disables GitOps, Flux installs Flux controllers, ArgoCD installs Argo CD) (default None)
-h, --help help for update
--import-images string Path to tar archive with container images to import after cluster creation but before component installation
-k, --kubeconfig string Path to kubeconfig file (default "~/.kube/config")
--local-registry string Local registry specification: [user:pass@]host[:port][/path] (e.g., localhost:5050, ghcr.io/myorg, ${USER}:${PASS}@ghcr.io:443/org)
--metrics-server MetricsServer Metrics Server (Default: use distribution, Enabled: install, Disabled: uninstall)
--mirror-registry strings Configure mirror registries with format 'host=upstream' (e.g., docker.io=https://registry-1.docker.io)
-n, --name string Cluster name used for container names, registry names, and kubeconfig context
--policy-engine PolicyEngine Policy engine (None: skip, Kyverno: install Kyverno, Gatekeeper: install Gatekeeper)
--provider Provider Infrastructure provider backend (e.g., Docker)
--workers int32 Number of worker nodes

Global Flags:
--benchmark Show per-activity benchmark output
```
1 change: 1 addition & 0 deletions pkg/cli/cmd/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func NewClusterCmd(runtimeContainer *runtime.Runtime) *cobra.Command {

cmd.AddCommand(NewInitCmd(runtimeContainer))
cmd.AddCommand(NewCreateCmd(runtimeContainer))
cmd.AddCommand(NewUpdateCmd(runtimeContainer))
cmd.AddCommand(NewDeleteCmd(runtimeContainer))
cmd.AddCommand(NewStartCmd(runtimeContainer))
cmd.AddCommand(NewStopCmd(runtimeContainer))
Expand Down
Loading
Loading