From 43f908e0068f0e66aae94db017660bbcb3107964 Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Wed, 5 Jun 2024 09:49:48 -0600 Subject: [PATCH] Remove nginx Smee services when Smee's in hostNetwork mode: This removes issues when both Smee and nginx want to listen on the same ports. Signed-off-by: Jacob Weinstock --- tinkerbell/stack/templates/nginx-configmap.yaml | 4 ++++ tinkerbell/stack/templates/nginx.yaml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/tinkerbell/stack/templates/nginx-configmap.yaml b/tinkerbell/stack/templates/nginx-configmap.yaml index bd36b51d..37f5be07 100644 --- a/tinkerbell/stack/templates/nginx-configmap.yaml +++ b/tinkerbell/stack/templates/nginx-configmap.yaml @@ -15,6 +15,7 @@ data: user root; http { + {{- if not .Values.smee.hostNetwork }} server { listen {{ .Values.smee.http.port }}; location / { @@ -26,6 +27,7 @@ data: proxy_pass http://$smee_dns:{{ .Values.smee.http.port }}; } } + {{- end }} server { listen {{ .Values.hegel.service.port }}; @@ -65,6 +67,7 @@ data: stream { log_format logger-json escape=json '{"source": "nginx", "time": $msec, "address": "$remote_addr", "status": $status, "upstream_addr": "$upstream_addr"}'; + {{- if not .Values.smee.hostNetwork }} server { listen {{ .Values.smee.tftp.port }} udp; resolver $POD_NAMESERVER; @@ -79,5 +82,6 @@ data: proxy_pass $smee_dns:{{ .Values.smee.syslog.port }}; access_log /dev/stdout logger-json; } + {{- end }} } {{- end }} diff --git a/tinkerbell/stack/templates/nginx.yaml b/tinkerbell/stack/templates/nginx.yaml index 09ab4dc9..b31f89dd 100644 --- a/tinkerbell/stack/templates/nginx.yaml +++ b/tinkerbell/stack/templates/nginx.yaml @@ -60,6 +60,7 @@ spec: - containerPort: {{ .Values.stack.hook.port }} protocol: TCP name: hook-http + {{- if not .Values.smee.hostNetwork }} - containerPort: {{ .Values.smee.http.port }} protocol: TCP name: {{ .Values.smee.http.name }} @@ -69,6 +70,7 @@ spec: - containerPort: {{ .Values.smee.syslog.port }} protocol: UDP name: {{ .Values.smee.syslog.name }} + {{- end }} resources: limits: cpu: 500m