refactor: CPU config to millicores, fix replica health, reorder tabs
- Rename cpuShares to cpuRequest (millicores), cpuLimit from cores to millicores. ResolvedContainerConfig translates to Docker-native units via dockerCpuShares() and dockerCpuQuota() helpers. Future K8s orchestrator can pass millicores through directly. - Fix waitForAnyHealthy to wait for ALL replicas instead of returning on first healthy one. Prevents false DEGRADED status with 2+ replicas. - Default app detail to Configuration tab (was Overview) - Reorder config sub-tabs: Monitoring, Resources, Variables, Traces & Taps, Route Recording Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -17,8 +17,8 @@ public final class ConfigMerger {
|
||||
return new ResolvedContainerConfig(
|
||||
intVal(appConfig, envConfig, "memoryLimitMb", global.memoryLimitMb()),
|
||||
intOrNull(appConfig, envConfig, "memoryReserveMb"),
|
||||
intVal(appConfig, envConfig, "cpuShares", global.cpuShares()),
|
||||
doubleOrNull(appConfig, envConfig, "cpuLimit"),
|
||||
intVal(appConfig, envConfig, "cpuRequest", global.cpuRequest()),
|
||||
intOrNull(appConfig, envConfig, "cpuLimit"),
|
||||
intVal(appConfig, envConfig, "appPort", 8080),
|
||||
intList(appConfig, envConfig, "exposedPorts"),
|
||||
stringMap(appConfig, envConfig, "customEnvVars"),
|
||||
@@ -88,7 +88,7 @@ public final class ConfigMerger {
|
||||
/** Global defaults extracted from application.yml @Value fields */
|
||||
public record GlobalRuntimeDefaults(
|
||||
int memoryLimitMb,
|
||||
int cpuShares,
|
||||
int cpuRequest,
|
||||
String routingMode,
|
||||
String routingDomain,
|
||||
String serverUrl
|
||||
|
||||
@@ -6,8 +6,8 @@ import java.util.Map;
|
||||
public record ResolvedContainerConfig(
|
||||
int memoryLimitMb,
|
||||
Integer memoryReserveMb,
|
||||
int cpuShares,
|
||||
Double cpuLimit,
|
||||
int cpuRequest,
|
||||
Integer cpuLimit,
|
||||
int appPort,
|
||||
List<Integer> exposedPorts,
|
||||
Map<String, String> customEnvVars,
|
||||
@@ -26,4 +26,14 @@ public record ResolvedContainerConfig(
|
||||
public Long memoryReserveBytes() {
|
||||
return memoryReserveMb != null ? (long) memoryReserveMb * 1024 * 1024 : null;
|
||||
}
|
||||
|
||||
/** Convert cpuRequest (millicores) to Docker CPU shares (proportional to 1024 = 1 core). */
|
||||
public int dockerCpuShares() {
|
||||
return cpuRequest * 1024 / 1000;
|
||||
}
|
||||
|
||||
/** Convert cpuLimit (millicores) to Docker CPU quota (microseconds per 100ms period). */
|
||||
public Long dockerCpuQuota() {
|
||||
return cpuLimit != null ? (long) cpuLimit * 100 : null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user