Loki 日志系统分布式部署实践二 consul

说明

本次部署初始使用了 consul,但是最终因为大 key 导致放弃 consul,consul 默认 512KB 的 key,但还是把这个组件的部署方式放出来

安装

添加 repo:

# helm repo add hashicorp https://helm.releases.hashicorp.com
# helm repo update

查看版本:

# helm search repo hashicorp/consul
NAME                    CHART VERSION   APP VERSION     DESCRIPTION                    
hashicorp/consul        0.26.0          1.8.5           Official HashiCorp Consul Chart

下载包:

# helm pull hashicorp/consul --version=0.26.0

查看可以自定义的字段:

# helm show values consul-0.26.0.tgz

创建自定义配置文件:
参考:https://www.consul.io/docs/k8s/helm.html#v-global

# cat > consul-config.yaml <

创建 consul 集群:

# kubectl create ns consul
# helm install consul consul-0.26.0.tgz --set global.name=consul -f consul-config.yaml --namespace consul 
NAME: consul
LAST DEPLOYED: Wed Nov 11 18:53:35 2020
NAMESPACE: consul
STATUS: deployed
REVISION: 1
NOTES:
Thank you for installing HashiCorp Consul!

Now that you have deployed Consul, you should look over the docs on using 
Consul with Kubernetes available here: 

https://www.consul.io/docs/platform/k8s/index.html


Your release is named consul.

To learn more about the release if you are using Helm 2, run:

  $ helm status consul
  $ helm get consul

To learn more about the release if you are using Helm 3, run:

  $ helm status consul
  $ helm get all consul

查看:

# helm list -n consul -n consul
NAME    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
consul  consul          1               2020-11-11 18:59:09.010549253 +0800 CST deployed        consul-0.25.0   1.8.4      

# kubectl get pod,svc -l app=consul -n consul
NAME                  READY   STATUS    RESTARTS   AGE
pod/consul-server-0   1/1     Running   0          44s
pod/consul-server-1   1/1     Running   0          44s
pod/consul-server-2   1/1     Running   0          44s

NAME                    TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)                                                                   AGE
service/consul-dns      ClusterIP   172.31.61.228           53/TCP,53/UDP                                                             44s
service/consul-server   ClusterIP   None                    8500/TCP,8301/TCP,8301/UDP,8302/TCP,8302/UDP,8300/TCP,8600/TCP,8600/UDP   44s
service/consul-ui       ClusterIP   172.31.63.134           80/TCP                                                                    44s

创建 Ingress:

# cat > consul-ui-ingress.yaml <

访问 consul web:
http://consul.sit.hupu.io

image.png

你可能感兴趣的:(Loki 日志系统分布式部署实践二 consul)