Closed spigell closed 2 years ago
I dont know much about using connman-vpn directly but if it helps the following approach works for me
k3os:
modules:
- wireguard
write_files:
- encoding: ""
content: |-
apiVersion: v1
kind: ConfigMap
metadata:
name: wireguard-configmap-client
data:
SERVERURL: ""
PUID: "1000"
PGID: "1000"
TZ: "Europe/Berlin"
SERVERPORT: ""
ALLOWEDIPS: ""
INTERNAL_SUBNET: ""
---
apiVersion: v1
kind: ConfigMap
metadata:
name: wireguard-configmap-client-connection
data:
wg0.conf: |
[Interface]
Address =
PrivateKey =
ListenPort = 51820
[Peer]
PublicKey =
Endpoint =
AllowedIPs =
PersistentKeepalive = 25
---
apiVersion: v1
kind: Pod
metadata:
name: wireguard-client
labels:
app: wireguard-client
spec:
hostNetwork: true
containers:
- name: wireguard-client
image: ghcr.io/linuxserver/wireguard:version-v1.0.20210424
envFrom:
- configMapRef:
name: wireguard-configmap-client
securityContext:
capabilities:
add:
- NET_ADMIN
- SYS_MODULE
privileged: true
volumeMounts:
- name: wg-config-client-connection
mountPath: /config
- name: host-volumes
mountPath: /lib/modules
ports:
- containerPort: 51820
protocol: UDP
resources:
requests:
memory: "64Mi"
cpu: "100m"
limits:
memory: "128Mi"
cpu: "200m"
volumes:
- name: wg-config-client-connection
configMap:
name: wireguard-configmap-client-connection
items:
- key: wg0.conf
path: wg0.conf
- name: host-volumes
hostPath:
path: /lib/modules
type: Directory
owner: root
path: /var/lib/rancher/k3s/server/manifests/wireguard.yaml
@andrewwebber thanks for workaround. I end up using write files with run_cmd
write_files:
- encoding: b64
content: 'W0ludGVyZmFjZV0K...'
path: /etc/wireguard/kubewg0.conf
run_cmd:
- sudo wg-quick up kubewg0
glad you got it working @spigell and thank you for sharing @andrewwebber !
Greetings!
Version (k3OS / kernel)
Architecture
Describe the bug When connman-vpn trying to load wireguard vpn config there is error in log. VPN do not up also.
To Reproduce
Expected behavior Plugin starts to work (maybe complaining about bad config)
Actual behavior Error in logs