Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions interlink/templates/virtual-kubelet-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ data:
TunnelImage: {{.Values.virtualNode.network.tunnelImage | default "ghcr.io/erebe/wstunnel:latest" | quote}}
WildcardDNS: {{.Values.virtualNode.network.wildcardDNS | default "" | quote}}
WstunnelTemplatePath: {{.Values.virtualNode.network.wstunnelTemplatePath | default "/etc/templates/wstunnel.yaml" | quote}}
WstunnelDebugLevel: {{.Values.virtualNode.network.wstunnelDebugLevel | default "DEBUG" | quote}}
WstunnelCommand: {{ .Values.virtualNode.network.wstunnelCommand | quote }}
{{- if .Values.virtualNode.network.fullMesh }}
FullMesh: {{ .Values.virtualNode.network.fullMesh }}
Expand Down Expand Up @@ -130,15 +131,17 @@ data:
{{- end }}
{{- end }}
---
{{- if .Values.virtualNode.network.enableTunnel }}
{{- if and .Values.virtualNode.network.enableTunnel (not .Values.virtualNode.network.useExternalConfigMap) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ .Values.nodeName }}-wstunnel-template"
namespace: {{ .Release.Namespace }}
data:
wstunnel.yaml: |
{{- if .Values.virtualNode.network.customTemplate }}
{{- if .Values.virtualNode.network.externalTemplate }}
{{ .Files.Get .Values.virtualNode.network.externalTemplate | indent 4 }}
{{- else if .Values.virtualNode.network.customTemplate }}
{{ .Values.virtualNode.network.customTemplate | indent 4 }}
{{- else if eq .Values.virtualNode.network.templateType "nginx" }}
{{ .Files.Get "wstunnel-template_nginx.yaml" | indent 4 }}
Expand Down
4 changes: 4 additions & 0 deletions interlink/templates/virtual-kubelet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,11 @@ spec:
{{- if .Values.virtualNode.network.enableTunnel }}
- name: wstunnel-template
configMap:
{{- if .Values.virtualNode.network.useExternalConfigMap }}
name: {{ .Values.virtualNode.network.externalTemplate }}
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When useExternalConfigMap is true, the ConfigMap name is taken directly from virtualNode.network.externalTemplate. If externalTemplate is empty (the default), this will render an invalid volume reference and the Pod will fail to start. Consider enforcing that externalTemplate is non-empty when useExternalConfigMap is true (e.g., using Helm's required function or by adding a conditional that errors out).

Suggested change
name: {{ .Values.virtualNode.network.externalTemplate }}
name: {{ required "virtualNode.network.externalTemplate must be set when virtualNode.network.useExternalConfigMap is true" .Values.virtualNode.network.externalTemplate }}

Copilot uses AI. Check for mistakes.
{{- else }}
name: {{.Values.nodeName}}-wstunnel-template
{{- end }}
{{- end }}


Expand Down
8 changes: 8 additions & 0 deletions interlink/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ virtualNode:
templateType: ""
# Custom wstunnel template content (optional, overrides templateType if set)
customTemplate: ""
# External template reference (overrides customTemplate and templateType if set)
# Can be a local file path (e.g., "wstunnel-template_custom.yaml") or ConfigMap name
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

externalTemplate is documented as accepting a "local file path", but the chart uses .Files.Get to load it, which only reads files packaged inside the Helm chart. If users set an arbitrary local path at install time, Helm will fail with a "file not found" render error. Please clarify the comment to indicate it must be a chart file path (or recommend using customTemplate/--set-file for truly local content).

Suggested change
# Can be a local file path (e.g., "wstunnel-template_custom.yaml") or ConfigMap name
# When useExternalConfigMap is false, this must be a path to a file packaged inside this Helm chart
# (for example, "wstunnel-template_custom.yaml"), not an arbitrary local filesystem path.
# For truly local content at install/upgrade time, use customTemplate or --set-file instead.

Copilot uses AI. Check for mistakes.
externalTemplate: ""
# Use existing ConfigMap for template instead of creating one
# If set to true, externalTemplate is treated as ConfigMap name
useExternalConfigMap: false
# Wstunnel debug level (e.g., "DEBUG", "INFO", "WARN", "ERROR")
wstunnelDebugLevel: "DEBUG"
wstunnelCommand: |
curl -L https://github.com/erebe/wstunnel/releases/download/v10.4.4/wstunnel_10.4.4_linux_amd64.tar.gz -o wstunnel.tar.gz && tar -xzvf wstunnel.tar.gz && chmod +x wstunnel && ./wstunnel client --http-upgrade-path-prefix %s %s ws://%s:80 &

Expand Down
2 changes: 1 addition & 1 deletion interlink/wstunnel-template_nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
spec:
containers:
- args:
- ./wstunnel server --log-lvl DEBUG --dns-resolver-prefer-ipv4 --restrict-http-upgrade-path-prefix {{.RandomPassword}} ws://0.0.0.0:28080
- ./wstunnel server --log-lvl {{.WstunnelDebugLevel}} --dns-resolver-prefer-ipv4 --restrict-http-upgrade-path-prefix {{.RandomPassword}} ws://0.0.0.0:28080
command:
- bash
- -c
Expand Down
2 changes: 1 addition & 1 deletion interlink/wstunnel-template_traefik.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ spec:
spec:
containers:
- args:
- ./wstunnel server --log-lvl DEBUG --dns-resolver-prefer-ipv4 --restrict-http-upgrade-path-prefix {{.RandomPassword}} ws://0.0.0.0:28080
- ./wstunnel server --log-lvl {{.WstunnelDebugLevel}} --dns-resolver-prefer-ipv4 --restrict-http-upgrade-path-prefix {{.RandomPassword}} ws://0.0.0.0:28080
command:
- bash
- -c
Expand Down