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
84 changes: 76 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Key features:
- Controlled concurrent node upgrades
- Automatic workload draining with PDB enforcement
- Configurable failure budgets with automatic halt on threshold breach
- Maintenance window support with date exclusions
- Pause and resume support for manual intervention
- Real-time upgrade status tracking

Expand Down Expand Up @@ -111,12 +112,6 @@ spec:
namespace: kangal-patch
```

Apply the PatchPlan:

```bash
kubectl apply -f patchplan.yaml
```

**Example using Talos Factory images:**

The `target` specification uses individual fields to construct the factory image URL. The operator builds the full URL in the format:
Expand Down Expand Up @@ -161,7 +156,63 @@ spec:
namespace: kangal-patch
```

### 3. Monitor Progress

### 3. Optional: Configure Maintenance Windows

Restrict patching to specific time windows and exclude certain dates:

```yaml
apiVersion: kangalpatch.ozalp.dk/v1alpha1
kind: PatchPlan
metadata:
name: talos-upgrade-maintenance
spec:
targetVersion: "ghcr.io/siderolabs/installer:v1.11.6"

# ... other configuration ...

# Maintenance windows
maintenance:
# Exclude specific dates (holidays, blackout periods)
excludeDates:
- "2026-12-24"
- "2026-12-25"
- "2026-12-26"
- "2026-12-31"
- "2027-01-01"

# Define when patching is allowed (UTC)
windows:
# Monday and Friday early morning
- days: ["Monday", "Friday"] # Supports: "Monday", "Mon", "monday"
startTime: "01:00"
endTime: "05:00"

# Wednesday night window
- days: ["Wed"]
startTime: "22:00"
endTime: "02:00" # Spans midnight

# Every day window (omit days field or use ["Any"])
- startTime: "03:00"
endTime: "04:00"
```

**Notes on maintenance windows:**
- All times are in UTC
- Day names support full names ("Monday"), 3-letter abbreviations ("Mon"), case-insensitive
- Omit `days` field or use `["Any"]` to match all days
- Windows can span midnight (e.g., 22:00 to 02:00)
- Patching will be paused outside maintenance windows
- Exclude dates use YYYY-MM-DD format

Apply the PatchPlan:

```bash
kubectl apply -f patchplan.yaml
```

### 4. Monitor Progress

Watch the upgrade progress:

Expand All @@ -187,7 +238,7 @@ $ kubectl get patchplan simple-upgrade -o jsonpath='{.status}' | jq
}
```

### 4. Pause/Resume
### 5. Pause/Resume

Pause an ongoing upgrade:

Expand Down Expand Up @@ -224,6 +275,23 @@ kubectl patch patchplan simple-upgrade --type merge -p '{"spec":{"paused":false}
| `patchWorkers` | bool | Patch worker nodes | `true` |
| `controlPlaneFirst` | bool | Patch control plane first | `false` |
| `paused` | bool | Pause operation | `false` |
| `maintenance` | object | Maintenance window configuration | `nil` |

#### Maintenance Spec

| Field | Type | Description |
|-------|------|-------------|
| `excludeDates` | []string | List of dates (YYYY-MM-DD) to exclude from patching |
| `windows` | []MaintenanceWindow | List of time windows when patching is allowed |

#### MaintenanceWindow

| Field | Type | Description |
|-------|------|-------------|
| `days` | []string | Days of week (e.g., "Monday", "Mon"). Empty = all days |
| `startTime` | string | Start time in HH:MM format (UTC) |
| `endTime` | string | End time in HH:MM format (UTC) |
| `disabled` | bool | Temporarily disable this window |

## Development

Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
topologyKey: kubernetes.io/hostname
containers:
- name: manager
image: ghcr.io/uozalp/kangal-patch:0.1.1
image: ghcr.io/uozalp/kangal-patch:0.1.2
imagePullPolicy: IfNotPresent
command:
- /manager
Expand Down
4 changes: 2 additions & 2 deletions helm/kangal-patch/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: kangal-patch
description: A Kubernetes operator for orchestrating Talos Linux cluster upgrades.
type: application
version: 0.1.1
appVersion: "0.1.1"
version: 0.1.2
appVersion: "0.1.2"
keywords:
- talos
- kubernetes
Expand Down
Loading