官方文档: https://www.consul.io/docs/k8s/installation/install
官方文件总会有一些坑。 以下是我整理的安装文件:
#添加官方helm仓库 helm repo add hashicorp https://helm.releases.hashicorp.com #确定可安装版本 helm search repo hashicorp/consul #使用默认配置安装,请注意helm 3.7版本,如果报Error: unknown flag: --create-namespace 说明你的helm版本太低了 helm install consul hashicorp/consul --set global.name=consul --create-namespace -n consul ##安装自定义配置文件 helm install consul hashicorp/consul --set global.name=consul --create-namespace -n consul -f config.yaml #自定义配置文件内容config.yaml global: name: consul # Bootstrap ACLs within Consul. This is highly recommended. acls: manageSystemACLs: true # Gossip encryption gossipEncryption: autoGenerate: true # Configure your Consul servers in this section. server: # Specify three servers that wait until all are healthy to bootstrap the Consul cluster. replicas: 3 storage: 20Gi st