Consul add Kubernetes node

3/27/2020

I have installed and configured Consul cluster on VM nodes. I would like to add there another nodes in client mode, not in SERVER mode. These nodes should run on Kubernetes. I have used HELM template but I'm not able to add there these nodes in CLIENT mode but only in server node. HELM TEMPLATE: https://github.com/helm/charts/tree/master/stable/consul

I want to use this for service registration to Consul cluster. Does anyone has any idea or experience with this?

-- Jiří Šafář
consul
kubernetes
kubernetes-helm

1 Answer

4/28/2020

The official Consul helm chart (https://github.com/hashicorp/consul-helm/) supports this. You'll want to deploy the Helm chart using a configuration similar to the following.

# By default disable all resources in the Helm chart
global:
  enabled: false

# Enable Client nodes
client:
  enabled: true
  # Set this to true to expose the Consul clients using the Kubernetes node
  # IPs. If false, the pod IPs must be routable from the external servers.
  exposeGossipPorts: true

  # IPs of your external Consul server(s)
  join:
    - 192.0.2.10
    - 192.0.2.20
    - 192.0.2.30

See the Consul Servers Outside of Kubernetes docs for details.

-- Blake C
Source: StackOverflow