@@ -255,12 +255,10 @@ async def ensure_namespace_security(self) -> None:
255255
256256 Creates:
257257 - Default-deny NetworkPolicy for executor pods (blocks lateral movement and exfiltration)
258- - ResourceQuota to cap aggregate CPU/memory consumption (no pod count limit)
259258 - Pod Security Admission labels (Restricted profile)
260259 """
261260 namespace = self ._settings .K8S_NAMESPACE
262261 await self ._ensure_executor_network_policy (namespace )
263- await self ._ensure_executor_resource_quota (namespace )
264262 await self ._apply_psa_labels (namespace )
265263
266264 async def _ensure_executor_network_policy (self , namespace : str ) -> None :
@@ -290,35 +288,6 @@ async def _ensure_executor_network_policy(self, namespace: str) -> None:
290288 )
291289 self .logger .info (f"NetworkPolicy '{ policy_name } ' applied in namespace { namespace } " )
292290
293- async def _ensure_executor_resource_quota (self , namespace : str ) -> None :
294- """Create or update ResourceQuota to cap aggregate CPU/memory in the executor namespace."""
295- quota_name = "executor-quota"
296-
297- quota = k8s_client .V1ResourceQuota (
298- api_version = "v1" ,
299- kind = "ResourceQuota" ,
300- metadata = k8s_client .V1ObjectMeta (
301- name = quota_name ,
302- namespace = namespace ,
303- labels = {"app" : "integr8s" , "component" : "security" },
304- ),
305- spec = k8s_client .V1ResourceQuotaSpec (
306- hard = {
307- "requests.cpu" : self ._settings .K8S_QUOTA_CPU ,
308- "requests.memory" : self ._settings .K8S_QUOTA_MEMORY ,
309- "limits.cpu" : self ._settings .K8S_QUOTA_CPU ,
310- "limits.memory" : self ._settings .K8S_QUOTA_MEMORY ,
311- },
312- ),
313- )
314-
315- await self .v1 .patch_namespaced_resource_quota ( # type: ignore[call-arg]
316- name = quota_name , namespace = namespace , body = quota ,
317- field_manager = "integr8s" , force = True ,
318- _content_type = "application/apply-patch+yaml" ,
319- )
320- self .logger .info (f"ResourceQuota '{ quota_name } ' applied in namespace { namespace } " )
321-
322291 async def _apply_psa_labels (self , namespace : str ) -> None :
323292 """Apply Pod Security Admission labels to the executor namespace."""
324293 psa_labels = {
0 commit comments