官方文档:
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
storageClass: alicloud-disk-essd
# Specify th