2020from dstack ._internal .core .backends .base .offers import filter_offers_by_requirements
2121from dstack ._internal .core .backends .kubernetes .models import (
2222 KubernetesConfig ,
23- KubernetesNetworkingConfig ,
23+ KubernetesProxyJumpConfig ,
2424)
2525from dstack ._internal .core .backends .kubernetes .utils import (
2626 call_api_method ,
@@ -69,10 +69,10 @@ class KubernetesCompute(
6969 def __init__ (self , config : KubernetesConfig ):
7070 super ().__init__ ()
7171 self .config = config .copy ()
72- networking_config = self .config .networking
73- if networking_config is None :
74- networking_config = KubernetesNetworkingConfig ()
75- self .networking_config = networking_config
72+ proxy_jump = self .config .proxy_jump
73+ if proxy_jump is None :
74+ proxy_jump = KubernetesProxyJumpConfig ()
75+ self .proxy_jump = proxy_jump
7676 self .api = get_api_from_config_data (config .kubeconfig .data )
7777
7878 def get_offers_by_requirements (
@@ -143,7 +143,7 @@ def run_job(
143143 # as an ssh proxy jump to connect to all other services in Kubernetes.
144144 # Setup jump pod in a separate thread to avoid long-running run_job.
145145 # In case the thread fails, the job will be failed and resubmitted.
146- jump_pod_hostname = self .networking_config . ssh_host
146+ jump_pod_hostname = self .proxy_jump . hostname
147147 if jump_pod_hostname is None :
148148 jump_pod_hostname = get_cluster_public_ip (self .api )
149149 if jump_pod_hostname is None :
@@ -156,7 +156,7 @@ def run_job(
156156 namespace = self .config .namespace ,
157157 project_name = run .project_name ,
158158 ssh_public_keys = [project_ssh_public_key .strip (), run .run_spec .ssh_key_pub .strip ()],
159- jump_pod_port = self .networking_config . ssh_port ,
159+ jump_pod_port = self .proxy_jump . port ,
160160 )
161161 if not created :
162162 threading .Thread (
@@ -820,11 +820,11 @@ def _run_ssh_command(hostname: str, port: int, ssh_private_key: str, command: st
820820
821821
822822def _get_jump_pod_name (project_name : str ) -> str :
823- return f"{ project_name } -ssh-jump-pod"
823+ return f"dstack- { project_name } -ssh-jump-pod"
824824
825825
826826def _get_jump_pod_service_name (project_name : str ) -> str :
827- return f"{ project_name } -ssh-jump-pod-service"
827+ return f"dstack- { project_name } -ssh-jump-pod-service"
828828
829829
830830def _get_pod_service_name (pod_name : str ) -> str :
0 commit comments