Hi there,
I’ve tried running a server instance on K8s and connecting virtual machine clients outside the cluster.
To deploy the server instance, I’m using the official helm chart.
Since I want to connect from external, I expose the service:
global:
enabled: false
name: consul
server:
enabled: true
replicas: 1
exposeService:
enabled: true
# exposeGossipAndRPCPorts: true
# ports:
# serflan:
# port: 9301
ui:
enabled: true
ingress:
enabled: true
hosts:
- host: consul-hawkv6.stud.network.garden
As soon as I deploy it with Helm, the following services are deployed:
k get svc -n hawkv6-consul
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
consul-connect-injector ClusterIP 10.105.101.215 <none> 443/TCP 4s
consul-dns ClusterIP 10.103.12.243 <none> 53/TCP,53/UDP 4s
consul-expose-servers LoadBalancer 10.110.61.225 10.8.39.70 8500:32018/TCP,8301:30217/TCP,8300:32084/TCP,8502:31537/TCP 4s
consul-server ClusterIP None <none> 8500/TCP,8502/TCP,8301/TCP,8301/UDP,8302/TCP,8302/UDP,8300/TCP,8600/TCP,8600/UDP 4s
consul-ui ClusterIP 10.96.31.30 <none> 80/TCP
Furthermore, the pods are deployed:
k get pods -n hawkv6-consul
NAME READY STATUS RESTARTS AGE
consul-connect-injector-6b99dfbccf-6njf4 1/1 Running 0 84s
consul-server-0 1/1 Running 0 84s
consul-webhook-cert-manager-546dbcc5c6-9njwx 1/1 Running 0 84s
So far, the UI is working, and the server started properly.
Now, when I start the agent, I can observe that the client can join but that it has connection issues. I can observe that the answer is not coming from the LoadBalancerIp but from the internal pod IP, which is not reachable from the virtual machines.
See here for more information.
consul-server.log.txt (13.7 KB)
consul.log.txt (12.1 KB)
I have already tried to use a NodePort instead of LoadBalancer and also tried to use the exposeGossipAndRPCPorts and change the serflan port. Nothing is working.
When I change the serflan port, I can not join in general.
Is there even a way to connect virtual machines to a server running on K8s without a route to the internal pod IP?
Can somebody help?
Thanks a lot.
Cheers,
Severin