astroctl_infra_kubernetes_upgrade
astroctl infra kubernetes upgrade
Upgrade cluster Kubernetes version
Synopsis
Upgrade a cluster's Kubernetes version.
This operation is IRREVERSIBLE - the control plane cannot be downgraded. Server enforces: no version skipping, no downgrades.
ROLLING UPDATE STRATEGY
The --max-surge and --max-unavailable flags control how nodes are upgraded:
--max-surge: Extra nodes created DURING upgrade (requires additional capacity) --max-unavailable: Nodes that can be DOWN during upgrade (reduces capacity)
These settings are applied PER NODE GROUP. Example with 3 node groups:
Cluster: my-cluster ├── ng-system: 3 nodes (critical) → maxSurge=1, maxUnavailable=0 ├── ng-app: 10 nodes (general) → maxSurge=2, maxUnavailable=1 └── ng-workers: 20 nodes (batch) → maxSurge=10%, maxUnavailable=10%
UPGRADE PROCESS (each node group upgraded sequentially):
- ng-system: Creates 1 extra node, drains old → needs 4 nodes temporarily
- ng-app: Creates 2 extra, drains 3 at a time → needs 12 nodes temporarily
- ng-workers: Creates 2 extra (10% of 20), drains 2 → needs 22 nodes temporarily
TOTAL CAPACITY NEEDED: max(4, 12, 22) = 22 nodes at peak
RECOMMENDED STRATEGIES
PRODUCTION (default - extra capacity needed): --max-surge 1 --max-unavailable 0 Creates 1 extra node, zero downtime, needs N+1 nodes per group
COST-SENSITIVE (no extra capacity needed): --max-surge 0 --max-unavailable 1 No extra nodes, upgrades in-place, temporary reduced capacity
FAST UPGRADE (more parallelism, more capacity): --max-surge 25% --max-unavailable 0 Creates 25% extra nodes, faster but needs more capacity
For other changes (scaling, provider settings), use: astroctl infra k8s update <cluster> -f update.yaml astroctl infra k8s scale <cluster> <nodegroup> --min X --max Y
astroctl infra kubernetes upgrade <cluster-name> [version] [flags]
Examples
# List available versions for upgrade
astroctl infra k8s upgrade my-cluster --list-versions
# Upgrade to Kubernetes 1.30 (uses production-safe defaults)
astroctl infra k8s upgrade my-cluster 1.30
# Preview upgrade without applying
astroctl infra k8s upgrade my-cluster 1.30 --dry-run
# Generate upgrade readiness report (includes capacity analysis)
astroctl infra k8s upgrade my-cluster 1.30 --generate-report
# Skip confirmation prompt
astroctl infra k8s upgrade my-cluster 1.30 --yes
# PRODUCTION: Safe upgrade with zero downtime (default)
# Creates 1 extra node per group, needs extra capacity
astroctl infra k8s upgrade my-cluster 1.30 --max-surge 1 --max-unavailable 0
# COST-SENSITIVE: No extra capacity needed (slower)
# Upgrades in-place, one node at a time
astroctl infra k8s upgrade my-cluster 1.30 --max-surge 0 --max-unavailable 1
# FAST: Parallel upgrades (needs more capacity)
# Upgrades 25% of nodes at a time
astroctl infra k8s upgrade my-cluster 1.30 --max-surge 25% --max-unavailable 0
# BALANCED: Mix of surge and unavailable
astroctl infra k8s upgrade my-cluster 1.30 --max-surge 1 --max-unavailable 1
Options
--dry-run Preview upgrade without applying changes
--generate-report Generate comprehensive upgrade readiness report
-h, --help help for upgrade
--list-versions List available Kubernetes versions for this cluster
--max-surge string Maximum number of nodes (or percentage like '25%') that can be created above desired count during rolling update
--max-unavailable string Maximum number of nodes (or percentage like '25%') that can be unavailable during rolling update
--output string Output format for upgrade report (json, yaml, markdown) (default "json")
--yes Skip confirmation prompt
SEE ALSO
- astroctl infra kubernetes - Manage Kubernetes clusters