Commit ddc4896
authored
regions fixes (#5246)
* fix: improve rollbacks
This addresses a few things.
The most obvious one is lowering the freshness of some frontline caches
to make rollbacks faster.
I also moved the entire deployment workflow to a virtual object, keyed
by workspace id. The reason is that we had some potential races and this
is the pragmatic fix for right now. I could've done it per app too, but
I actually think limiting concurrency in the beginning is not a bad
thing. afterall, we're paying for all of these resources.
* feat: scaling and region tables
* fix: replace AVAILABLE_REGIONS env var with clusterRegions table query
* fix: update instances mutation to use appScalingSettings table
* fix: update CPU mutation to use appScalingSettings table
* fix: update memory mutation to use appScalingSettings table
* fix: update regions mutation to use appScalingSettings and clusterRegions tables
* fix: revert cpu/memory mutations back to appRuntimeSettings
* feat: rename app_scaling_settings to app_regional_settings, add horizontal_autoscaling_policies table
* feat: replace regionConfig with appRegionalSettings across dashboard
* fix: remove AVAILABLE_REGIONS from .env.example
* feat: add migration script for region_config to app_regional_settings
* feat: add Heartbeat RPC to ClusterService proto
* feat: add heartbeat loop to krane agent
Krane now sends periodic heartbeats to the control plane every 30s,
reporting its region and platform. Also adds Platform config field,
fixes duplicate r.Recover()/r.DeferCtx calls, and updates mock client.
* feat: implement Heartbeat RPC handler and rename cluster_regions to regions
- Add Heartbeat handler on ctrl that upserts regions and clusters tables
- Rename cluster_regions table to regions for clarity
- Remove AvailableRegions config from ctrl api/worker
- Deploy workflow now fails with terminal error if no regions configured
- Certificate bootstrap queries regions from DB instead of config
- Add SQL queries: UpsertRegion, FindRegionByNameAndPlatform, ListRegions, UpsertCluster
* feat: deploy workflow reads from appRegionalSettings, add region_id to deployment_topology
- Deploy handler now reads regions from app_regional_settings table
instead of deprecated regionConfig on app_runtime_settings
- Fails with terminal error if no regions are configured
- Added region_id column to deployment_topology table
- Added FindAppRegionalSettingsByAppAndEnv SQL query with regions join
- Updated integration harness to create regions before topologies
* fix: display region names in UI, add local region support
- Join regions table when fetching regional settings to get region name
- Use region name (not ID) for display in runtime settings
- Add "local" flag code to sentinel node types and REGION_INFO
* feat: add X-Krane-Platform header, app_id to ApplySentinel, and appId labels
- Add X-Krane-Platform header alongside X-Krane-Region in the krane
interceptor so ctrl can identify regions by (name, platform) pair
- All ctrl RPC handlers now validate both region and platform from headers
- Add app_id field to ApplySentinel proto message
- Add AppID label to all sentinel sub-resources (Service, PDB, gossip
Service, CiliumNetworkPolicy) for consistency with deployment labels
- Remove hardcoded region list from sentinel config validation (regions
are now dynamic from DB)
- Add platform field to sentinel config
* fix: step conflict
* fix: rabbit
* fix: frontline uses correct platform/region
* feat: add running state
* fix: relation key
* fix: unique key1 parent c37a7e6 commit ddc4896
File tree
102 files changed
+1544
-376
lines changed- dev
- config
- k8s/manifests
- docs/engineering/architecture/services/control-plane
- api
- worker
- gen
- proto/ctrl/v1
- ctrlv1connect
- rpc/ctrl
- pkg
- db
- queries
- uid
- svc
- ctrl
- api
- integration
- harness
- proto/ctrl/v1
- services
- cluster
- deployment
- worker
- deployment
- deploy
- frontline
- routes/proxy
- services
- proxy
- router
- krane
- internal
- sentinel
- testutil
- pkg/controlplane
- sentinel
- web
- apps/dashboard
- app/(app)/[workspaceSlug]/projects
- [projectId]
- (overview)
- deployments/[deploymentId]/network/unkey-flow/components/nodes
- settings/components/runtime-settings
- components
- new/steps
- gen/proto/ctrl/v1
- lib
- collections/deploy
- trpc/routers/deploy
- environment-settings
- runtime
- network
- internal/db/src/schema
- tools/migrate
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
102 files changed
+1544
-376
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
Lines changed: 1 addition & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
| |||
117 | 115 | | |
118 | 116 | | |
119 | 117 | | |
120 | | - | |
121 | 118 | | |
122 | 119 | | |
123 | 120 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | 41 | | |
43 | 42 | | |
44 | 43 | | |
| |||
126 | 125 | | |
127 | 126 | | |
128 | 127 | | |
129 | | - | |
130 | 128 | | |
131 | 129 | | |
132 | 130 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments