# Consul Server outside Kubernetes Cluster

**URL:** <https://discuss.hashicorp.com/t/consul-server-outside-kubernetes-cluster/22573>\
**Category:** Consul\
**Tags:** k8s\
**Created:** [March 28, 2021, 12:26am UTC](https://discuss.hashicorp.com/t/consul-server-outside-kubernetes-cluster/22573 "2021-03-28T00:26:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![debjit.kar](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/debjit.kar/32/17948_2.png) [@debjit.kar](https://discuss.hashicorp.com/u/debjit.kar)\
**Post date:** [March 28, 2021, 12:26am UTC](https://discuss.hashicorp.com/t/consul-server-outside-kubernetes-cluster/22573/1 "2021-03-28T00:26:46Z")

</div>

We are running Consul server outside our Kubernetes cluster. Upong deploying Consul client on Kubernetes the Server dashboard frequently updates the state of the Kubernetes nodes between “Agent live and reachable” and immediately shows “Agent not live or unreachable”. This is happening continuously in a loop.

> externalServers:  
> enabled: true  
> hosts: [“\*\*\*\*”]  
> httpsPort: 8501  
> tlsServerName: null  
> useSystemRoots: false  
> k8sAuthMethodHost: null  
> client:  
> enabled: true  
> image: null  
> join:  
> - \*\*\*\*\*\*\*\*\*  
> dataDirectoryHostPath: “”  
> grpc: true  
> exposeGossipPorts: true  
> securityContext:  
> runAsNonRoot: true  
> runAsGroup: 1000  
> runAsUser: 100  
> fsGroup: 1000  
> extraVolumes:   
> tolerations: “”  
> nodeSelector: null  
> affinity: null  
> priorityClassName: “”  
> annotations: null  
> extraLabels: null  
> extraEnvironmentVars: {}  
> dnsPolicy: “ClusterFirst”  
> hostNetwork: false  
> updateStrategy: null

---

<div class="post-metadata">

**Author:** ![Ranjandas](https://avatars.discourse-cdn.com/v4/letter/r/90ced4/32.png) [@Ranjandas](https://discuss.hashicorp.com/u/Ranjandas)\
**Post date:** [March 29, 2021, 12:22am UTC](https://discuss.hashicorp.com/t/consul-server-outside-kubernetes-cluster/22573/2 "2021-03-29T00:22:50Z")

</div>

Hi @debjit.kar,

Could you validate that all the consul agents in your cluster (including server and client agents) are able to talk to Kubernetes Nodes on port 8301 (both UDP and TCP) and similarly the Kubernetes nodes are able to talk to all other Consul agents outside K8S cluster on port 8301 UDP and TCP? Refer to the following link for the network requirements and also how health check works in Consul.  
(ref: [Consul Reference Architecture | Consul - HashiCorp Learn](https://learn.hashicorp.com/tutorials/consul/reference-architecture#network-connectivity-details))

To me, it sounds like your LAN gossip health checks are failing as some of the nodes in your cluster is not able to ping the K8S nodes and they are marking K8S nodes as failed.

If you look at the logs from Consul nodes you should be able to find out why the nodes are marked as unreachable.

---

<div class="post-metadata">

**Author:** ![lkysow](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/lkysow/32/1105_2.png) [@lkysow](https://discuss.hashicorp.com/u/lkysow)\
**Post date:** [March 29, 2021, 8:39pm UTC](https://discuss.hashicorp.com/t/consul-server-outside-kubernetes-cluster/22573/3 "2021-03-29T20:39:29Z")

</div>

Agreed, also see [Consul Clients Outside of Kubernetes - Kubernetes | Consul by HashiCorp](https://www.consul.io/docs/k8s/installation/deployment-configurations/clients-outside-kubernetes)

---

<div class="post-metadata">

**Author:** ![debjit.kar](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/debjit.kar/32/17948_2.png) [@debjit.kar](https://discuss.hashicorp.com/u/debjit.kar)\
**Post date:** [March 31, 2021, 4:45pm UTC](https://discuss.hashicorp.com/t/consul-server-outside-kubernetes-cluster/22573/4 "2021-03-31T16:45:57Z")

</div>

Thanks @Ranjandas. It is working fine now.
