@@ -15,7 +15,7 @@ pub const DEFAULT_SANDBOX_SERVICE_ACCOUNT_NAME: &str = "default";
1515/// Default storage size for the workspace PVC.
1616pub const DEFAULT_WORKSPACE_STORAGE_SIZE : & str = "2Gi" ;
1717
18- /// Default UID for the long-running Kubernetes network supervisor sidecar .
18+ /// Default UID for the long-running Kubernetes network proxy .
1919pub const DEFAULT_PROXY_UID : u32 = 1337 ;
2020
2121/// How the supervisor binary is delivered into sandbox pods.
@@ -65,13 +65,17 @@ pub enum SupervisorTopology {
6565 /// Run network supervision in a privileged sidecar and process supervision
6666 /// as a low-capability wrapper in the agent container.
6767 Sidecar ,
68+ /// Run network supervision in a separate supervisor pod and process
69+ /// supervision as a low-capability wrapper in the agent pod.
70+ ProxyPod ,
6871}
6972
7073impl std:: fmt:: Display for SupervisorTopology {
7174 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
7275 match self {
7376 Self :: Combined => f. write_str ( "combined" ) ,
7477 Self :: Sidecar => f. write_str ( "sidecar" ) ,
78+ Self :: ProxyPod => f. write_str ( "proxy-pod" ) ,
7579 }
7680 }
7781}
@@ -83,22 +87,23 @@ impl FromStr for SupervisorTopology {
8387 match s {
8488 "combined" => Ok ( Self :: Combined ) ,
8589 "sidecar" => Ok ( Self :: Sidecar ) ,
90+ "proxy-pod" => Ok ( Self :: ProxyPod ) ,
8691 other => Err ( format ! ( "unknown supervisor topology '{other}'" ) ) ,
8792 }
8893 }
8994}
9095
91- /// Process/filesystem controls applied by the process supervisor in split
92- /// Kubernetes topologies.
96+ /// Process/filesystem controls applied by the process supervisor in
97+ /// non-combined Kubernetes topologies.
9398#[ derive( Debug , Clone , Copy , PartialEq , Eq , Default , Serialize , Deserialize ) ]
9499#[ serde( rename_all = "kebab-case" ) ]
95100pub enum ProcessEnforcementMode {
96- /// Preserve process launch and session relay behavior, but leave
97- /// filesystem/process guards to the network supervisor topology .
101+ /// Preserve process launch and session relay behavior while network
102+ /// enforcement is handled by the sidecar or proxy pod .
98103 #[ default]
99104 NetworkOnly ,
100- /// Run the process supervisor with the same process/filesystem controls as
101- /// combined topology .
105+ /// Run the process supervisor with combined-mode process/filesystem
106+ /// controls .
102107 Full ,
103108}
104109
@@ -255,9 +260,10 @@ pub struct KubernetesComputeConfig {
255260 /// non-combined topologies. `network-only` keeps the low-permission agent
256261 /// shape; `full` grants the agent supervisor combined-mode controls.
257262 pub process_enforcement : ProcessEnforcementMode ,
258- /// UID used by the long-running network sidecar in `sidecar` topology.
259- /// The network init container installs nftables rules that exempt this
260- /// UID, so it must not match the sandbox workload UID.
263+ /// UID used by the long-running network proxy in sidecar and proxy-pod
264+ /// topologies. In sidecar topology, the network init container installs
265+ /// nftables rules that exempt this UID, so it must not match the sandbox
266+ /// workload UID.
261267 pub proxy_uid : u32 ,
262268 pub grpc_endpoint : String ,
263269 pub ssh_socket_path : String ,
@@ -565,6 +571,16 @@ mod tests {
565571 assert_eq ! ( cfg. supervisor_topology, SupervisorTopology :: Combined ) ;
566572 }
567573
574+ #[ test]
575+ fn serde_override_supervisor_topology_proxy_pod ( ) {
576+ let json = serde_json:: json!( {
577+ "supervisor_topology" : "proxy-pod"
578+ } ) ;
579+ let cfg: KubernetesComputeConfig = serde_json:: from_value ( json) . unwrap ( ) ;
580+ assert_eq ! ( cfg. supervisor_topology, SupervisorTopology :: ProxyPod ) ;
581+ assert_eq ! ( cfg. supervisor_topology. to_string( ) , "proxy-pod" ) ;
582+ }
583+
568584 #[ test]
569585 fn serde_override_process_enforcement_full ( ) {
570586 let json = serde_json:: json!( {
0 commit comments