From e4434c76172a49d0dbf046a034bf16e357735203 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Fri, 20 Sep 2024 17:07:12 +0200 Subject: [PATCH] Add UDP traefik route to shadowsocks --- common/templates.yaml | 7 ++++ installations/applications/helmfile.yaml | 1 + .../values.shadowsocks-libev.yaml | 8 +++++ values/badhouseplants/values.traefik.yaml | 32 +++++++++++-------- values/common/values.udp-route.yaml | 19 +++++++++++ values/etersoft/values.traefik.yaml | 32 +++++++++++-------- 6 files changed, 73 insertions(+), 26 deletions(-) create mode 100644 values/common/values.udp-route.yaml diff --git a/common/templates.yaml b/common/templates.yaml index e38d689..c93ae7c 100644 --- a/common/templates.yaml +++ b/common/templates.yaml @@ -54,6 +54,13 @@ templates: alias: traefik values: - '{{ requiredEnv "PWD" }}/values/common/values.tcp-route.yaml' + ext-udp-routes: + dependencies: + - chart: bedag/raw + version: 2.0.0 + alias: traefik-udp + values: + - '{{ requiredEnv "PWD" }}/values/common/values.udp-route.yaml' ext-traefik-middleware: dependencies: - chart: bedag/raw diff --git a/installations/applications/helmfile.yaml b/installations/applications/helmfile.yaml index daa1fc7..bfb7347 100644 --- a/installations/applications/helmfile.yaml +++ b/installations/applications/helmfile.yaml @@ -93,6 +93,7 @@ releases: - template: default-env-secrets - template: default-env-values - template: ext-tcp-routes + - template: ext-udp-routes - name: navidrome chart: allangers-charts/navidrome namespace: applications diff --git a/values/badhouseplants/values.shadowsocks-libev.yaml b/values/badhouseplants/values.shadowsocks-libev.yaml index b58cd9d..670199a 100644 --- a/values/badhouseplants/values.shadowsocks-libev.yaml +++ b/values/badhouseplants/values.shadowsocks-libev.yaml @@ -6,3 +6,11 @@ traefik: match: HostSNI(`*`) entrypoint: shadowsocks port: 8388 +traefik-udp: + enabled: true + tcpRoutes: + - name: shadowsocks-libev + service: shadowsocks-libev-shadowsocks + match: HostSNI(`*`) + entrypoint: shadowsocks-udp + port: 8388 diff --git a/values/badhouseplants/values.traefik.yaml b/values/badhouseplants/values.traefik.yaml index ab08613..5bb8fd8 100644 --- a/values/badhouseplants/values.traefik.yaml +++ b/values/badhouseplants/values.traefik.yaml @@ -16,18 +16,18 @@ ports: default: true exposedPort: 1194 protocol: TCP - valve-server: - port: 27015 - expose: - default: true - exposedPort: 27015 - protocol: UDP - valve-rcon: - port: 27015 - expose: - default: true - exposedPort: 27015 - protocol: TCP + # valve-server: + # port: 27015 + # expose: + # default: true + # exposedPort: 27015 + # protocol: UDP + # valve-rcon: + # port: 27015 + # expose: + # default: true + # exposedPort: 27015 + # protocol: TCP smtp: port: 25 protocol: TCP @@ -45,7 +45,7 @@ ports: protocol: TCP exposedPort: 587 expose: - default: true + default: true imap: port: 143 protocol: TCP @@ -82,3 +82,9 @@ ports: exposedPort: 8388 expose: default: true + shadowsocks-udp: + port: 8388 + protocol: UDP + exposedPort: 8388 + expose: + default: true diff --git a/values/common/values.udp-route.yaml b/values/common/values.udp-route.yaml new file mode 100644 index 0000000..099a09b --- /dev/null +++ b/values/common/values.udp-route.yaml @@ -0,0 +1,19 @@ +traefik-udp: + templates: + - | + {{ range .Values.tcpRoutes }} + --- + apiVersion: traefik.io/v1alpha1 + kind: IngressRouteUDP + metadata: + name: {{ .name }} + spec: + entryPoints: + - {{ .entrypoint }} + routes: + - match: {{ .match }} + services: + - name: {{ .service }} + nativeLB: true + port: {{ .port }} + {{- end }} diff --git a/values/etersoft/values.traefik.yaml b/values/etersoft/values.traefik.yaml index ab08613..c17aaec 100644 --- a/values/etersoft/values.traefik.yaml +++ b/values/etersoft/values.traefik.yaml @@ -16,18 +16,18 @@ ports: default: true exposedPort: 1194 protocol: TCP - valve-server: - port: 27015 - expose: - default: true - exposedPort: 27015 - protocol: UDP - valve-rcon: - port: 27015 - expose: - default: true - exposedPort: 27015 - protocol: TCP + # valve-server: + # port: 27015 + # expose: + # default: true + # exposedPort: 27015 + # protocol: UDP + # valve-rcon: + # port: 27015 + # expose: + # default: true + # exposedPort: 27015 + # protocol: TCP smtp: port: 25 protocol: TCP @@ -45,7 +45,7 @@ ports: protocol: TCP exposedPort: 587 expose: - default: true + default: true imap: port: 143 protocol: TCP @@ -82,3 +82,9 @@ ports: exposedPort: 8388 expose: default: true + shadowsocks-udp: + port: 8389 + protocol: UDP + exposedPort: 8389 + expose: + default: true