removed vpn
This commit is contained in:
1 parent
38609ebfcf
commit
6037c913c5
3 files changed
-120
No files matched your search
@@ -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 }}
|
||||
@@ -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"
|
||||
@@ -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 }}
|
||||
Reference in new issue
Block a user