From 6037c913c50874caf36dfdb1f9c5765f60ba5479 Mon Sep 17 00:00:00 2001 From: Ariel Sosnovsky Date: Mon, 17 Apr 2023 16:48:35 -0400 Subject: [PATCH] removed vpn --- .../templates/_helpers/openvpn-container.yaml | 92 ------------------- .../templates/configs-openvpn.yaml | 20 ---- .../templates/sts-linuxservices.yaml | 8 -- 3 files changed, 120 deletions(-) delete mode 100644 k8s/apps/videohosting/templates/_helpers/openvpn-container.yaml delete mode 100644 k8s/apps/videohosting/templates/configs-openvpn.yaml diff --git a/k8s/apps/videohosting/templates/_helpers/openvpn-container.yaml b/k8s/apps/videohosting/templates/_helpers/openvpn-container.yaml deleted file mode 100644 index edee707..0000000 --- a/k8s/apps/videohosting/templates/_helpers/openvpn-container.yaml +++ /dev/null @@ -1,92 +0,0 @@ -{{ define "homelab.nordvpn" }} -- name: vpn - stdin: true - tty: true - securityContext: - privileged: true - capabilities: - add: - - NET_ADMIN - - NET_RAW - volumeMounts: - - name: vpn-config - mountPath: /vpn/client.ovpn - subPath: client.ovpn - - name: vpn-config - mountPath: /vpn/auth.txt - subPath: auth.txt - - name: vpn-tmp - mountPath: /tmp/route - image: ghcr.io/bubuntux/nordvpn - env: - - name: TZ - value: "{{ .Values.global.timezone }}" - - name: TOKEN - valueFrom: - secretKeyRef: - name: openvpn-creds - key: nordvpn_token - - name: CONNECT - value: Canada - - name: TECHNOLOGY - value: NordLynx - # - name: NETWORK - # value: NordLynx -{{ end }} - -{{ define "homelab.openvpn.container" }} -- name: vpn - image: dperson/openvpn-client - command: ["/bin/sh","-c"] - args: ["openvpn --config 'vpn/client.ovpn' --auth-user-pass 'vpn/auth.txt' --script-security 3 --route-up /tmp/route/route-override.sh;"] - stdin: true - tty: true - securityContext: - privileged: true - capabilities: - add: - - NET_ADMIN - env: - - name: TZ - value: "{{ .Values.global.timezone }}" - volumeMounts: - - name: vpn-config - mountPath: /vpn/client.ovpn - subPath: client.ovpn - - name: vpn-config - mountPath: /vpn/auth.txt - subPath: auth.txt - - name: vpn-tmp - mountPath: /tmp/route -{{ end }} - -{{ define "homelab.openvpn.initContainer" }} -- name: vpn-route-init - image: busybox - command: ['/bin/sh', '-c', 'cp /vpn/route-override.sh /tmp/route/route-override.sh; chown root:root /tmp/route/route-override.sh; chmod o+x /tmp/route/route-override.sh;'] - volumeMounts: - - name: vpn-tmp - mountPath: /tmp/route - - name: route-script - mountPath: /vpn/route-override.sh - subPath: route-override.sh -{{ end }} - -{{ define "homelab.openvpn.volumes" }} -- name: vpn-config - secret: - secretName: openvpn-creds - items: - - key: client.ovpn - path: client.ovpn - - key: auth.txt - path: auth.txt -- name: route-script - configMap: - name: openvpn-route-script - items: - - key: route-override.sh - path: route-override.sh -- name: vpn-tmp - emptyDir: {} -{{ end }} \ No newline at end of file diff --git a/k8s/apps/videohosting/templates/configs-openvpn.yaml b/k8s/apps/videohosting/templates/configs-openvpn.yaml deleted file mode 100644 index ab99d41..0000000 --- a/k8s/apps/videohosting/templates/configs-openvpn.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -apiVersion: v1 -kind: Secret -metadata: - name: openvpn-creds -type: Opaque -data: - _placeholder: "" - ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: openvpn-route-script -data: - route-override.sh: |- - #!/bin/sh - VPN_GATEWAY=$(route -n | awk 'NR==3' | awk '{ print $2 }') - ip route del 0.0.0.0/1 via $VPN_GATEWAY - echo "Route Updated" \ No newline at end of file diff --git a/k8s/apps/videohosting/templates/sts-linuxservices.yaml b/k8s/apps/videohosting/templates/sts-linuxservices.yaml index bb5a7c3..2e6772e 100644 --- a/k8s/apps/videohosting/templates/sts-linuxservices.yaml +++ b/k8s/apps/videohosting/templates/sts-linuxservices.yaml @@ -75,12 +75,6 @@ spec: values: - med - low - dnsConfig: - nameservers: - - 8.8.8.8 - - 8.8.4.4 - initContainers: - {{- include "homelab.openvpn.initContainer" . | nindent 8 }} containers: - name: {{$k}} image: "{{ $v.repo }}:{{ $v.tag }}" @@ -105,12 +99,10 @@ spec: mountPath: /config - name: torrents mountPath: /torrents - {{- include "homelab.nordvpn" $ | nindent 8 }} volumes: - name: torrents nfs: server: "{{ $.Values.global.nfs.server }}" path: "{{ $.Values.global.nfs.additionalShares.torrents }}" readOnly: false - {{- include "homelab.openvpn.volumes" . | nindent 8 }} {{ end }} \ No newline at end of file