Description
Config used:
{
"local": {
"name": "local"
},
"remotes": [
{
"name": "remot",
"kubeConfigPath": "/config", # kubeconfig config of remot cluster
"podSubnet": "1.1.128.0/17",
"remoteSATokenPath": "/etc/semaphore-wireguard/tokens/remote1/token",
"wgListenPort": 51824
}
]
}
Logs of the service:
[INFO] semaphore-wireguard: No key found, generating a new private key: path=/var/lib/semaphore-wireguard/wireguard.remot.key
semaphore-wireguard: Configuring wireguard: device=wireguard.remot port=51824 pubKey=<an encrypted key>
1 shared_informer.go:240] Waiting for caches to sync for nodeWatcher
[INFO] semaphore-wireguard: starting node watcher
[WARN] semaphore-wireguard: Cannot sync peers while canSync flag is not set
1 shared_informer.go:247] Caches are synced for nodeWatcher
Route after the service is up:
[~]$ route -n
1.1.128.0 0.0.0.0 255.255.128.0 U 0 0 0 wireguard.remot
172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0
nodes on remot cluster has route similar route similar to above but with interface being wireguard.local and for destination 2.2.128.0(pod network of local)
--- Connectivity check from one of the node(10.10.12.125) hosting pods:
[~]$ ping 1.1.133.154
PING 1.1.133.154 (1.1.133.154) 56(84) bytes of data.
From 10.10.12.125 icmp_seq=1 Destination Host Unreachable
ping: sendmsg: Required key not available
---- route get from node(10.10.12.125)
[~]$ ip route get 1.1.133.154
1.1.133.154 dev wireguard.remot src 20.20.133.5
cache
---- Remote key present
[ ~]$ ls /var/lib/semaphore-wireguard/wireguard.remot.key
/var/lib/semaphore-wireguard/wireguard.remot.key
----- tcpdump on the remote node(20.20.133.5):
[ ~]$ sudo tcpdump -n -i eth0 'src or dst 10.10.12.125'
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
09:27:23.649518 IP 20.20.133.5.51824 > 10.10.12.125.51824: UDP, length 32
09:27:48.666056 IP 10.10.12.125.51824 > 20.20.133.5.51824: UDP, length 32
---- Communication between nodes in two clusters exist
Note: Pods were up on both clusters before semaphore wireguard is launched. Hope this should not be an issue.
@george-angel @ffilippopoulos Can I get some help? May be I am something?