2 Commits

Author SHA1 Message Date
e0812f28aa Output json logs except when running through cargo
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m25s
2025-04-17 16:54:37 +02:00
62a85230a9 Fixed conflict with service links
All checks were successful
Build and deploy / Build container and manifests (push) Successful in 5m31s
2025-04-17 15:59:03 +02:00
4 changed files with 18 additions and 9 deletions

View File

@@ -17,6 +17,8 @@ spec:
annotations: annotations:
kubectl.kubernetes.io/default-container: siranga kubectl.kubernetes.io/default-container: siranga
spec: spec:
# Service links cause issues with the HTTP_PORT and SSH_PORT env variables
enableServiceLinks: false
containers: containers:
- name: siranga - name: siranga
image: git.huizinga.dev/dreaded_x/siranga@${DIGEST} image: git.huizinga.dev/dreaded_x/siranga@${DIGEST}

View File

@@ -10,6 +10,6 @@ spec:
kind: Rule kind: Rule
services: services:
- name: http - name: http
port: 3000 port: http
tls: tls:
secretName: tunnel-tls secretName: tunnel-tls

View File

@@ -4,9 +4,8 @@ metadata:
name: http name: http
spec: spec:
ports: ports:
- name: "3000" - name: http
port: 3000 port: 3000
targetPort: 3000
selector: selector:
app: siranga app: siranga
--- ---
@@ -19,7 +18,7 @@ metadata:
spec: spec:
type: LoadBalancer type: LoadBalancer
ports: ports:
- name: "2222" - name: ssh
port: 22 port: 22
targetPort: 2222 targetPort: 2222
selector: selector:

View File

@@ -24,11 +24,19 @@ async fn main() -> color_eyre::Result<()> {
let env_filter = EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("info"))?; let env_filter = EnvFilter::try_from_default_env().or_else(|_| EnvFilter::try_new("info"))?;
let logger = tracing_subscriber::fmt::layer().compact(); if std::env::var("CARGO").is_ok() {
tracing_subscriber::Registry::default() let logger = tracing_subscriber::fmt::layer().compact();
.with(logger) tracing_subscriber::Registry::default()
.with(env_filter) .with(logger)
.init(); .with(env_filter)
.init();
} else {
let logger = tracing_subscriber::fmt::layer().json();
tracing_subscriber::Registry::default()
.with(logger)
.with(env_filter)
.init();
}
info!( info!(
"Starting {} ({})", "Starting {} ({})",