updated vpn values
This commit is contained in:
1 parent
fbd317fa19
commit
cb9d59b488
3 files changed
+115
-1
No files matched your search
@@ -27,7 +27,7 @@ authelia:
|
||||
revisionHistoryLimit: 1
|
||||
env:
|
||||
- name: TZ
|
||||
value: America/Toronto
|
||||
value: "America/Toronto"
|
||||
|
||||
resources:
|
||||
limits:
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
{{ define "homelab.nordvpn "}}
|
||||
- name: vpn
|
||||
image: ghcr.io/bubuntux/nordvpn
|
||||
stdin: true
|
||||
tty: true
|
||||
securityContext:
|
||||
privileged: true
|
||||
capabilities:
|
||||
add:
|
||||
- NET_ADMIN
|
||||
- NET_RAW
|
||||
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
|
||||
image: ghcr.io/bubuntux/nordvpn
|
||||
env:
|
||||
- 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 }}
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
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"
|
||||
Reference in new issue
Block a user