NordVPN Sidecar for Kubernetes
3.2K
A lightweight sidecar VPN solution for Kubernetes pods that redirects all pod traffic through NordVPN with optional split tunneling support.
Source: https://github.com/mm503/nordvpn-sidecar/
latest<version> (eg. 4.2.3)- name: TOKEN
valueFrom:
secretKeyRef:
name: nordvpn-credentials
key: token
| Variable | Default | Description |
|---|---|---|
MAX_RECONNECT_ATTEMPTS | 5 | Maximum reconnection attempts |
RECONNECT_INTERVAL | 30 | Seconds between reconnection attempts |
NORDVPN_KILLSWITCH | on | Enable/disable kill switch (on/off) |
NORDVPN_COUNTRY | unset | Target country (e.g., United_States) |
NORDVPN_CITY | unset | Target city (e.g., Dallas) |
ALLOW_SUBNETS | unset | Comma-separated subnets for split tunneling |
NORDVPN_DNS | unset | Comma-separated custom DNS servers (also allowlists port 53) |
apiVersion: v1
kind: Secret
metadata:
name: nordvpn-credentials
type: Opaque
data:
token: <base64-encoded-nordvpn-token>
apiVersion: v1
kind: Pod
metadata:
name: example-pod
spec:
initContainers:
- name: nordvpn-sidecar
image: mm404/nordvpn-sidecar:latest
restartPolicy: Always
env:
- name: TOKEN
valueFrom:
secretKeyRef:
name: nordvpn-credentials
key: token
- name: ALLOW_SUBNETS # Kubernetes networking, LAN
value: "10.42.0.0/16,10.43.0.0/16,192.168.1.0/24"
- name: NORDVPN_COUNTRY
value: United_States # Run "nordvpn countries" to see all options
- name: NORDVPN_CITY # Run "nordvpn cities United_States" to see city options for US
value: Miami
- name: MAX_RECONNECT_ATTEMPTS
value: "10"
- name: RECONNECT_INTERVAL
value: "60"
securityContext:
capabilities:
add:
- NET_ADMIN # Required for VPN to work
containers:
- name: main-container
image: your-app:latest
10.42.0.0/16 (k3s default)10.43.0.0/16 (k3s default)192.168.x.0/24 (adjust to your network)172.17.0.0/16 (if applicable)# Minimal (Kubernetes only)
ALLOW_SUBNETS: "10.42.0.0/16,10.43.0.0/16"
# With LAN access
ALLOW_SUBNETS: "10.42.0.0/16,10.43.0.0/16,192.168.1.0/24"
NET_ADMIN for network manipulationThis project uses the NordVPN client version as its release version. Image tags correspond to NordVPN client versions (following semver).
latest: Most recent stable release{version}: NordVPN client version (e.g., 4.2.2)Docker images are built and published automatically via GitHub Actions:
On Push to Main:
NORDVPN_VERSION in Dockerfile is detected from the buildmm404/nordvpn-sidecar:latestmm404/nordvpn-sidecar:{version}On Push to Non-Main Branches:
dev-{version}-{branch}-{sha}The version is automatically extracted from the NORDVPN_VERSION argument in the Dockerfile and embedded in the image via the GIT_REVISION build argument.
Content type
Image
Digest
sha256:c602a8a60…
Size
89.9 MB
Last updated
17 days ago
docker pull mm404/nordvpn-sidecar:5.2.0-752a7c9