Description
Rationale
currently the flag --port value
of the networking options sets the same port for both UDP and TCP connections.
The issue is that Kubernetes does not support Service
of type LoadBalancer
with mix protocol on the same port. Creating the following Service
:
apiVersion: v1
kind: Service
metadata:
name: geth-p2p
labels:
app: geth-p2p
spec:
type: LoadBalancer
selector:
app: geth
ports:
- name: listening
port: 30303
targetPort: 30303
protocol: TCP
- name: discovery
port: 30303
targetPort: 30303
protocol: UDP
fails with the error:
the Service "geth-p2p" is invalid: spec.ports: Invalid value [...] cannot create an external load balancer with mix protocols
I'm currently deploying a eth2.0 staking system with multiple validators and kubernetes is for me the platform of choice for managing multiple workloads.
There are some workarounds like this one https://medium.com/asl19-developers/build-your-own-cloud-agnostic-tcp-udp-loadbalancer-for-your-kubernetes-apps-3959335f4ec3 but I would hope it's not necessary to rely on such hacks.
However TCP only is working fine, my node can sync. Nonetheless, the discovery through UDP is obviously not working for workloads in kubernetes that share the same port for TCP or UDP.
Implementation
I haven’t looked in details in the code-base what would be the effort to decouple the 2 protocols. I believe I would start from there
go-ethereum/cmd/devp2p/keycmd.go
Line 63 in 053ed9c