You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can utilize Kubernetes Lease objects (coordination.k8s.io/v1) for implementing the distributed locking mechanism (open to discussion and suggestions). Leases are purpose-built for this use case, providing built-in lease duration and automatic expiration capabilities. For more information, see: <https://kubernetes.io/docs/concepts/architecture/leases/>.
385
-
386
405
Other CLI commands (`rad deploy app.bicep`, `rad delete app my-app` or other data-changing commands) that modify data will check for this lock before proceeding:
387
406
388
407
```go
@@ -533,7 +552,7 @@ The implementation will primarily focus on the following components:
533
552
534
553
1. **Upgrade Command**: The `rad upgrade kubernetes` command implementation in the CLI codebase
535
554
2. **Version Validation**: Logic to verify compatibility between versions
536
-
3. **Lock Mechanism**: Kubernetes Lease-based distributed locking system
555
+
3. **Lock Mechanism**: Data-store-level distributed locking system
537
556
4. **Backup/Restore**: User data protection system using ConfigMaps/PVs
538
557
5. **Helm Integration**: Enhanced wrapper around Helm's upgrade capabilities
539
558
6. **Health Verification**: Component readiness and health check mechanisms
@@ -592,6 +611,8 @@ behaviors or APIs.
592
611
593
612
The following outlines the key implementation steps required to deliver the Radius Control Plane upgrade feature. Each step includes necessary unit and functional tests to ensure reliability and correctness, along with dependency information.
594
613
614
+
### Version 1: Simple `rad upgrade kubernetes` command with incremental upgrade
615
+
595
616
1. **Radius Helm Client Updates**
596
617
597
618
- Implement the upgrade functionality in the Radius Helm client: [helmclient.go](https://github.com/radius-project/radius/blob/main/pkg/cli/helm/helmclient.go).
@@ -643,6 +664,92 @@ The following outlines the key implementation steps required to deliver the Radi
643
664
- Add necessary unit and functional tests to validate command behavior.
644
665
- This task depends on all previous tasks (1-6) and should be implemented last.
645
666
667
+
### Version 2: Data Store Migrations and Rollbacks
668
+
669
+
1. Pick & embed a migration tool
670
+
671
+
- Add `migrations/` dir and versioned SQL (or Go) files
672
+
- Vendor or import the tool (e.g. golang-migrate) so we have a single binary
673
+
674
+
2. Define migration tracking schema
675
+
676
+
- For Postgres: create a `schema_migrations` table (tool-standard)
677
+
- For etcd: track applied migrations via a reserved key prefix
678
+
679
+
3. Wiring in the CLI/server
680
+
681
+
- On install/upgrade: run `migrate up` before Helm chart upgrade
682
+
- On rollback: run `migrate down` (or tool-provided rollback) if upgrade fails
683
+
- (Optional) Expose `rad migrate status|up|down` commands for operators
684
+
685
+
4. Schema evolution helpers
686
+
687
+
- Provide utilities for common ops (add column, rename, rekey in etcd)
688
+
- Write examples/migrations: e.g. move key-value → Postgres row
689
+
690
+
5. Testing migrations
691
+
692
+
- Unit tests for each migration file (idempotent, up/down)
693
+
- Integration tests: start with old schema + data → apply migrations → verify shape
0 commit comments