Hi @blake,
Thanks for your reply!
Someone in my team deploys the consul server in a docker swarm with such parameters, and I need to deploy the consul client in a k8s cluster. So, I thought I needed to set similar parameters in the helm.
Here is the configure JSON they are used to create one of the consul servers (we have three servers: one leader , two worker):
{
"node_name": "consul-server3",
"server": true,
"ui_config": {
"enabled": true
},
"data_dir": "/consul/data",
"addresses": {
"http": "0.0.0.0"
},
"bind_addr": "0.0.0.0",
"advertise_addr": "192.168.10.3",
"retry_join": ["consul-server1", "consul-server2"],
"encrypt": "test",
"verify_incoming": false,
"verify_outgoing": true,
"verify_server_hostname": true,
"ca_file": "/consul/config/certs/ca-cert.pem",
"cert_file": "/consul/config/certs/server3.dc1.consul.crt",
"key_file": "/consul/config/certs/server3.dc1.consul.key"
}
here is the consul.yml that I am using to deploy the client on k8s (with helm):
global:
enabled: false
tls:
enabled: true
verify : true
enableAutoEncrypt : true
# caKey : // I thought I can use auto encrypt, so I comment this two lines here.
# caCert :
gossipEncryption:
secretName : "consul-gossip-encryption-key" // I create this k8s secrete using "encrypt".
externalServers:
enabled: true
hosts:
- '192.168.10.1'
- '192.168.10.2'
- '192.168.10.3'
client:
enabled: true
exposeGossipPorts: true
retry-join:
- '192.168.10.1' // for consul-server1
- '192.168.10.2' //for consul-server2
- '192.168.10.3' // for consul-server3
I am not sure if this client config aligns with the server?
Actually, I got a problem here :
I am using: helm install consul hashicorp/consul --create-namespace --namespace consul --values consul.yml
to deploy this client, and I can have this response:
NAME: consul
LAST DEPLOYED: Tue Mar 8 18:11:53 2022
NAMESPACE: consul
STATUS: deployed
REVISION: 1
NOTES:
Thank you for installing HashiCorp Consul!
Your release is named consul.
To learn more about the release, run:
$ helm status consul
$ helm get all consul
Consul on Kubernetes Documentation:
https://www.consul.io/docs/platform/k8s
Consul on Kubernetes CLI Reference:
https://www.consul.io/docs/k8s/k8s-cli
And when I input this: helm status consul
, it will say "Error: release: not found"
(same with helm get all consul ). Am I missing something here?
If I input: helm list -A
, I can get something like this :
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
consul consul 1 2022-03-08 19:45:24.812942169 +0000 UTC deployed consul-0.41.1 1.11.3
helm version: version.BuildInfo{Version:"v3.8.0", GitCommit:"d14138609b01886f544b2025f5000351c9eb092e", GitTreeState:"clean", GoVersion:"go1.17.5"}
(we have four servers in the k8s cluster)
Best
Yuxuan