Consul-helm: Consul HA on K8S cluster

Created on 11 May 2021  路  4Comments  路  Source: hashicorp/consul-helm

I'm running a POC that consists in deploy consul in a k8s cluster for HA. But, I figured out that service registering is randomly registered in each server in the cluster. So, what happens if one of the clusters fails? there is any way to sync servers or is it just a mistake in my helm config?

image

this is my consul deploy config:

global:
  name: consul
  datacenter: "MY-DC"
  # Gossip encryption
  gossipEncryption:
    secretName: 'consul-gossip-encryption-key'
    secretKey: 'key'
  acls:
    manageSystemACLs: true
server:
  replicas: 3
  bootstrapExpect: 3
client:
  enabled: true
ui:
  enabled: true
  ingress:
    enabled: true
    hosts:
      - host: consul.mydomain.com
    tls:
      - hosts:
        - consul.mydomain.com
        secretName: mydomaincom
question

All 4 comments

Hey @mateusdemboski

How are you registering services with the cluster? Usually, it's recommended to register services with a client running on the same host as your service rather than a server.

Hi @ishustava , I'm using the v1/agent/service endpoint across the ingress host.
A thing that I forget to mention is that all my services are outside the k8s cluster, but in the same DC

all my services are outside the k8s cluster

Do those services have a consul client co-located with them? If not, then you should register them as external-to-consul services. Here is a learn guide that goes over that.

Also, if you don't intend on running any services on k8s then you probably don't need to deploy consul clients, so you can set client.enabled to false in your Helm config.

@ishustava thank you for the support!

Was this page helpful?
0 / 5 - 0 ratings