wireguard-operator icon indicating copy to clipboard operation
wireguard-operator copied to clipboard

Unable to add any new clients in recent versions (2.0+)

Open xamindar opened this issue 1 year ago • 8 comments
trafficstars

Describe the bug New clients fail to install and work. Example client yaml: $ cat client-test.yaml

apiVersion: vpn.example.com/v1alpha1
kind: WireguardPeer
metadata:
  name: test
  namespace: radnimax-vpn
spec:
  wireguardRef: "radnimax-vpn"

To Reproduce Steps to reproduce the behavior:

  1. apply new client yaml: kubectl apply -f client-test.yaml
  2. run command to get peer information: kubectl -n radnimax-vpn get wireguardpeer test --template={{.status.config}} | bash
  3. Note the following error is returned instead of the peer configuration:
bash: line 1: syntax error near unexpected token `newline'
bash: line 1: `<no value>'
Note: without piping to bash, the return is simply "<no value>"

Expected behavior Should receive proper config info, which still happens with the existing clients already set up.

Additional context Existing client configs are able to be retrieved. It is only any new ones that are added now, that are not able to be retrieved.

xamindar avatar Mar 24 '24 22:03 xamindar

This is still a problem on v2.0.26.

xamindar avatar Apr 13 '24 11:04 xamindar

Hello,

What does kubectl -n radnimax-vpn get wireguardpeer test --template={{.status.config}} return?

jodevsa avatar Apr 16 '24 22:04 jodevsa

Hello,

What does kubectl -n radnimax-vpn get wireguardpeer test --template={{.status.config}} return?

It just returns no value:

$ kubectl -n radnimax-vpn get wireguardpeer test --template={{.status.config}}

xamindar avatar Apr 20 '24 06:04 xamindar

what about kubectl -n radnimax-vpn describe wireguardpeer test

jodevsa avatar Apr 20 '24 06:04 jodevsa

what about kubectl -n radnimax-vpn describe wireguardpeer test

Sorry for the delay, been busy. Here is the result:

[xamindar@hp2530p-xam wireguard-operator]$ kubectl -n radnimax-vpn describe wireguardpeer test Name: test Namespace: radnimax-vpn Labels: <none> Annotations: <none> API Version: vpn.example.com/v1alpha1 Kind: WireguardPeer Metadata: Creation Timestamp: 2024-04-20T06:31:52Z Generation: 1 Resource Version: 381408287 UID: 4f9de045-988d-493c-aad8-a5de4861aae7 Spec: Wireguard Ref: radnimax-vpn Events: <none> [xamindar@hp2530p-xam wireguard-operator]$

I have some time to troubleshoot it now but I think I will just blow it away and redeploy it at this point.

xamindar avatar May 10 '24 22:05 xamindar

Alright, so I removed it and my vpn "server/client" configs and redeployed. Now it isn't working at all. Applied release v2.0.30, then my server config in its own namespace just as I originally did. The only difference is updating the apiVersion to vpn.wireguard-operator.io/v1alpha1 as it's now listed on the readme page.

Now when I apply the client config, I just get nothing:

[xamindar@hp2530p-xam wireguard-operator]$ cat client-test.yaml apiVersion: vpn.wireguard-operator.io/v1alpha1 kind: WireguardPeer metadata: name: test namespace: radnimax-vpn spec: wireguardRef: "radnimax-vpn" [xamindar@hp2530p-xam wireguard-operator]$ kubectl apply -f client-test.yaml wireguardpeer.vpn.wireguard-operator.io/test created [xamindar@hp2530p-xam wireguard-operator]$ kubectl -n radnimax-vpn get wireguardpeer test --template={{.status.config}} Error from server (NotFound): the server could not find the requested resource (get wireguardpeers.vpn.example.com test) [xamindar@hp2530p-xam wireguard-operator]$

EDIT: nevermind, it is working now. Just took a little while.

One thing I noticed before I wiped it all out was it appears upgrading versions doesn't remove old CRDs so maybe that was the problem. I took them all out before I reinstalled everything: wireguardpeers.vpn.example.com 2023-01-23T05:05:23Z wireguardpeers.vpn.wireguard-operator.io 2024-05-10T22:41:07Z wireguards.vpn.example.com 2023-01-23T05:05:23Z wireguards.vpn.wireguard-operator.io 2024-05-10T22:41:07Z

xamindar avatar May 11 '24 00:05 xamindar

Hello,

I'm having the same issue, for me waiting did not solve it, I executed the commands as per the readme only adding the namespace to the wireguard resources, this is the state:

image

I tried with version 2.1.0 and 2.2.0 and same issue on both

ANBAL534 avatar Jul 08 '24 18:07 ANBAL534

Issue was a forever pending LoadBalancer Service type. changed server config to use NodePort and it solved the issue:

kind: Wireguard
metadata:
  name: "my-cool-vpn"
  namespace: wg-vpn
spec:
  serviceType: NodePort
  mtu: "1280"
  port: 30836

ANBAL534 avatar Jul 08 '24 21:07 ANBAL534