diff --git a/crates/openshell-bootstrap/src/docker.rs b/crates/openshell-bootstrap/src/docker.rs index 1cb62b7b9..3dc832aa6 100644 --- a/crates/openshell-bootstrap/src/docker.rs +++ b/crates/openshell-bootstrap/src/docker.rs @@ -526,9 +526,13 @@ pub async fn ensure_container( port_bindings: Some(port_bindings), binds: Some(vec![format!("{}:/var/lib/rancher/k3s", volume_name(name))]), network_mode: Some(network_name(name)), - // Add host.docker.internal mapping for DNS resolution - // This allows the entrypoint script to configure CoreDNS to use the host gateway - extra_hosts: Some(vec!["host.docker.internal:host-gateway".to_string()]), + // Add host gateway aliases for DNS resolution. + // This allows both the entrypoint script and the running gateway + // process to reach services on the Docker host. + extra_hosts: Some(vec![ + "host.docker.internal:host-gateway".to_string(), + "host.openshell.internal:host-gateway".to_string(), + ]), ..Default::default() }; diff --git a/deploy/helm/openshell/templates/statefulset.yaml b/deploy/helm/openshell/templates/statefulset.yaml index 175b2606f..83ece4994 100644 --- a/deploy/helm/openshell/templates/statefulset.yaml +++ b/deploy/helm/openshell/templates/statefulset.yaml @@ -31,6 +31,13 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "openshell.serviceAccountName" . }} + {{- if .Values.server.hostGatewayIP }} + hostAliases: + - ip: {{ .Values.server.hostGatewayIP | quote }} + hostnames: + - host.docker.internal + - host.openshell.internal + {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: