From b3efd37bccc7ef260cf03b44f1f0c09b29cab42d Mon Sep 17 00:00:00 2001 From: Dreaded_X Date: Thu, 17 Apr 2025 15:31:13 +0200 Subject: [PATCH] Fixed conflict with service links --- manifests/ingress-route.yaml | 2 +- manifests/service.yaml | 5 ++--- src/main.rs | 14 ++++++++++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/manifests/ingress-route.yaml b/manifests/ingress-route.yaml index bfaf618..532ad32 100644 --- a/manifests/ingress-route.yaml +++ b/manifests/ingress-route.yaml @@ -10,6 +10,6 @@ spec: kind: Rule services: - name: http - port: 3000 + port: http tls: secretName: tunnel-tls diff --git a/manifests/service.yaml b/manifests/service.yaml index f8eebd6..318db1c 100644 --- a/manifests/service.yaml +++ b/manifests/service.yaml @@ -4,9 +4,8 @@ metadata: name: http spec: ports: - - name: "3000" + - name: http port: 3000 - targetPort: 3000 selector: app: siranga --- @@ -19,7 +18,7 @@ metadata: spec: type: LoadBalancer ports: - - name: "2222" + - name: ssh port: 22 targetPort: 2222 selector: diff --git a/src/main.rs b/src/main.rs index bb6c570..571cf9e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -44,11 +44,17 @@ async fn main() -> color_eyre::Result<()> { russh::keys::PrivateKey::random(&mut OsRng, russh::keys::Algorithm::Ed25519)? }; - let http_port = std::env::var("HTTP_PORT") - .map(|port| port.parse().wrap_err_with(|| format!("HTTP_PORT={port}"))) + let http_port = std::env::var("HTTP_SERVICE_PORT") + .map(|port| { + port.parse() + .wrap_err_with(|| format!("HTTP_SERVICE_PORT={port}")) + }) .unwrap_or(Ok(3000))?; - let ssh_port = std::env::var("SSH_PORT") - .map(|port| port.parse().wrap_err_with(|| format!("SSH_PORT={port}"))) + let ssh_port = std::env::var("SSH_SERVICE_PORT") + .map(|port| { + port.parse() + .wrap_err_with(|| format!("SSH_SERVICE_PORT={port}")) + }) .unwrap_or(Ok(2222))?; let domain =