Skip to content

Commit 23af39a

Browse files
haimariclaude
andcommitted
fix: Only allow VM.Standard.E4.Flex and E5.Flex for right-sizing
B1.16 has 16 fixed CPUs but grafana-agent only needs 5 CPU + 30GB. E4.Flex and E5.Flex can be sized to exactly 3 OCPUs (6 vCPUs) + 30GB. - Block all other VM.Standard shapes (B1, E2, etc.) - Only allow E4.Flex and E5.Flex that support flexible sizing - This enables true right-sizing: 3 OCPUs instead of 16 CPUs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent dd978cb commit 23af39a

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

pkg/providers/oci/instancetypes.go

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,19 @@ func (p *InstanceTypeProvider) isAllowedShape(shapeName string) bool {
101101
}
102102
}
103103

104-
// Only allow x86-compatible Standard shape families (VM.Standard.E4.Flex, VM.Standard.E5.Flex, etc.)
105-
return strings.HasPrefix(shapeName, "VM.Standard")
104+
// Only allow specific cost-effective flexible shapes that can be right-sized
105+
allowedShapes := []string{
106+
"VM.Standard.E4.Flex", // x86 flexible shape - can be sized exactly for workload
107+
"VM.Standard.E5.Flex", // x86 flexible shape - can be sized exactly for workload
108+
}
109+
110+
for _, allowedShape := range allowedShapes {
111+
if strings.HasPrefix(shapeName, allowedShape) {
112+
return true
113+
}
114+
}
115+
116+
return false
106117
}
107118

108119
// GetDynamicInstanceTypes generates instance types based on pod requirements and NodePool configuration

0 commit comments

Comments
 (0)