部署的helm和manifest

yawyd313 afab9cf38c 资源文件使用缓存 hai 1 mes
argo-helm f1ed1fab88 init hai 11 meses
argo-workflow 0c28696fdf save hai 1 mes
bak_kafka 0c28696fdf save hai 1 mes
bak_kafka_ha 0c28696fdf save hai 1 mes
certmanager f1ed1fab88 init hai 11 meses
ch 0c28696fdf save hai 1 mes
ch-cold 0c28696fdf save hai 1 mes
ch-keeper f1ed1fab88 init hai 11 meses
ch-single 0c28696fdf save hai 1 mes
chaos-mesh 0c28696fdf save hai 1 mes
ck-cold be08088862 borui hai 1 ano
ck-ui f1ed1fab88 init hai 11 meses
clickhouse 0c28696fdf save hai 1 mes
clickhouse_etc 8c09984f9b resource hai 1 ano
createcert be08088862 borui hai 1 ano
data 0c28696fdf save hai 1 mes
dataroom 0c28696fdf save hai 1 mes
deepflow 0c28696fdf save hai 1 mes
dev f1ed1fab88 init hai 11 meses
dinky f1ed1fab88 init hai 11 meses
docker-registry 0c28696fdf save hai 1 mes
droneci 0c28696fdf save hai 1 mes
es 0199d5cd96 open telemetry hai 1 ano
flink f1ed1fab88 init hai 11 meses
flink-kubernetes-operator f1ed1fab88 init hai 11 meses
fluentd 0199d5cd96 open telemetry hai 1 ano
gogs 0c28696fdf save hai 1 mes
grafana 0c28696fdf save hai 1 mes
halo 0c28696fdf save hai 1 mes
hdfs 0c28696fdf save hai 1 mes
i6000pusher 0c28696fdf save hai 1 mes
ingress-nginx 0c28696fdf save hai 1 mes
jaeger 0199d5cd96 open telemetry hai 1 ano
jenkins f1ed1fab88 init hai 11 meses
kafka 0c28696fdf save hai 1 mes
kafka-delay f1ed1fab88 init hai 11 meses
kafka-ha 0c28696fdf save hai 1 mes
kafka-ui 0c28696fdf save hai 1 mes
kafka_bitnami d2cf03e329 ingre hai 1 ano
kibana 0199d5cd96 open telemetry hai 1 ano
loki-distributed f1ed1fab88 init hai 11 meses
metallb 0c28696fdf save hai 1 mes
metric-server f1ed1fab88 init hai 11 meses
minio f1ed1fab88 init hai 11 meses
mysql 0c28696fdf save hai 1 mes
mysql.bak 0c28696fdf save hai 1 mes
neo4j-helm f1ed1fab88 init hai 11 meses
network-policy 86bcc936c9 pre release hai 1 ano
nginx d5fddb15c7 init hai 1 ano
nginxgatewayfabric 9ddc501746 save hai 9 meses
ngx-proxy 0c28696fdf save hai 1 mes
oas-session 0c28696fdf save hai 1 mes
ob-agent-stream 0c28696fdf save hai 1 mes
ob-event 0c28696fdf save hai 1 mes
ob-proxy afab9cf38c 资源文件使用缓存 hai 1 mes
ob-server 0c28696fdf save hai 1 mes
ob-server_bak be08088862 borui hai 1 ano
ob-tools 0c28696fdf save hai 1 mes
ob2 f1ed1fab88 init hai 11 meses
obui 0c28696fdf save hai 1 mes
openebs f1ed1fab88 init hai 11 meses
operator 0c28696fdf save hai 1 mes
otel 0c28696fdf save hai 1 mes
otel-data-replay 0c28696fdf save hai 1 mes
prometheus 0c28696fdf save hai 1 mes
pycli f1ed1fab88 init hai 11 meses
rbac f1ed1fab88 init hai 11 meses
redis f1ed1fab88 init hai 11 meses
rook f1ed1fab88 init hai 11 meses
scripts f1ed1fab88 init hai 11 meses
swagger-ui 0c28696fdf save hai 1 mes
tempo d2cf03e329 ingre hai 1 ano
tempo-distributed f1ed1fab88 init hai 11 meses
test-oas 0c28696fdf save hai 1 mes
trace-stream-creator 0c28696fdf save hai 1 mes
victoria-metrics-cluster 0c28696fdf save hai 1 mes
xxl-jobs 0c28696fdf save hai 1 mes
.gitignore f1ed1fab88 init hai 11 meses
README.md 97e099da2c 文档优化 hai 1 ano
check.sh f1ed1fab88 init hai 11 meses
ingress-ceph-controller.yaml f1ed1fab88 init hai 11 meses
km1.imglist 8c09984f9b resource hai 1 ano
quota-observe.yaml d2cf03e329 ingre hai 1 ano
storageClass_local.yaml f1ed1fab88 init hai 11 meses
storageClass_tmp.yaml f1ed1fab88 init hai 11 meses

README.md

[TOC]

江苏电力全链路观测项目实施手册

基础设施

部署nginx ingress controller(如有跳过)

  • 使用helm chart/deploy/ingress-nginx安装

    helm install ingress-nginx . -n ingress-nginx
    
  • 如80、443端口不可用,修改contorller.hostPort

  • 修改controller.ingressResource.enable/default为true

  • node很多,将controller.kind改为deployment ,并设置nodeSelector,不然ingress解析不到

部署openebs storage provisioner(如有跳过)

kubectl apply -f deploy/openebs/openebs-operator.yaml	

数据存储

部署clickhouse

  • 使用deploy/clickhouse
  • 修改global.storageClass
  • 修改shardreplica
  • 修改auth.username, auth.password
  • 开启ingress
  • 修改persistence.storangeClass: openebs-hostpath

    helm install clickhouse . -n obse部署nginx ingress controller(如有跳过)部署nginx ingress controller(如有跳过)部署nginx ingress controller(如有跳过)rve  --create-namespace	
    

部署tempo

  • 使用deploy/tempo

  • 开启otel receiver

    otlp:
    protocols:
      grpc:
        endpoint: "0.0.0.0:4317"
      http:
        endpoint: "0.0.0.0:4318"
    
  • 配置metrics_generator_processors

    metrics_generator_processors:
     - 'service-graphs'
     - 'span-metrics'
    max_search_bytes_per_trace: 0
    
  • 配置tempo.metricGenerator, 指向部署的prometheus

    metricsGenerator:
      enabled: true
      remoteWriteUrl: "http://prometheus-server.observe.svc.cluster.local:80/api/v1/write"
    
  • 配置存储方式

    persistence:
    enabled: true
    storageClassName: openebs-hostpath
    
  • 执行部署

    helm install tempo . -n observe
    

MySQL-(数字化门户)

数据收集

prometheus

  • 使用deploy/prometheus

  • 修改persistentVolume.storageClass

  • 执行部署

    helm install prometheus . -n observe
    

opentelemetry-collector

  • 确定部署mode

  • 配置exportor

    otlp:
    endpoint: "tempo.observe.svc.cluster.local:4317"
    tls:
      insecure: true
    prometheus:
    endpoint: "0.0.0.0:8889"
    #namespace: default
    clickhouse:
    endpoint: "tcp://clickhouse-headless.observe.svc.cluster.local:9000?dial_timeout=10s&compress=lz4"
    database: otel
    username: default
    password: "cecf@cestong.com"
    ttl_days: 10
    #logs_table: otel_logs
    #traces_table: otel_traces
    #metrics_table: otel_metrics
    timeout: 5s
    retry_on_failure:
      enabled: true
      initial_interval: 5s
      max_interval: 30s
      max_elapsed_time: 300s
    
  • 开启otel receiver

    otlp:
    protocols:
      grpc:
        endpoint: ${MY_POD_IP}:4317
      http:
        endpoint: ${MY_POD_IP}:4318
    
  • 配置pipeline,把otel收到的trace输出至clickhousetempo ( otel )

  • 配置pipeline,把otel收到的metrics输出至clickhouseprometheus

  • 配置podAnnotations,让prometheus自动来采集收集到的metrics

    podAnnotations:
    prometheus.io/scrape: "true"
    prometheus.io/path: /metrics
    prometheus.io/port: "8889"
    
  • 执行部署

    helm install otel-collector . -n observe
    

数字化门户-数据清洗程序

部署流程

  1. 部署mysql

    • git地址:https://git.cestong.com.cn/cecf/cluster-config
      所有配置已经修改好,直接部署即可

      cd mysql
      helm -n observe install mysql .
      

      注意 当前配置使用的是NodePort向外暴露端口,端口固定为30306,客户环境可能需要更换,更换位置如下

      # values.yaml文件 477行
      476     nodePorts:
      477       mysql: "30306"
      
  2. 初始化sql

    # 获取mysql root密码
    MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace observe mysql -o jsonpath="{.data.mysql-root-password}" | base64 -d)
    # 进入到同一个命名空间的mysql客户端的pod中
    kubectl run mysql-client --rm --tty -i --restart='Never' --image  docker.io/bitnami/mysql:5.7.42-debian-11-r27 --namespace observe --env MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD --command -- bash
    # 登录mysql
    mysql -h mysql.observe.svc.cluster.local -uroot -p"$MYSQL_ROOT_PASSWORD"
    # 选择数据库
    use otel;
    # 执行sql语句
    
  3. 部署数据清洗程序

    • git地址: https://git.cestong.com.cn/cecf/datacleaner
    • 镜像地址: registry.cestong.com:8150/cecf/digit_portal_handler
    • 部署方式

      kubectl -n observe apply -f cronjob.yaml
      

      注意 要修改cronjob.yaml中 mysql 和 clickhouse 的用户及权限

数据可视化展示

grafana

  • 修改ingress,配置对应的域名

  • 配置persistence.storageClassName

  • 设置adminPassword

  • 执行部署

    helm install grafana . -n observe
    
  • 安装clickhouse插件

  • 设置tempo, prometheus, clickhouse数据源

  • 导入dashboard

observe-front/ui

  • 更改front/ui中的域名

  • 编译打包

  • 执行部署deploy/obui

    kubectl apply -f deployment-front.yaml  
    kubectl apply -f deployment.yaml  
    kubectl apply -f ingress_rewrite.yaml  
    kubectl apply -f ingress.yaml  
    kubectl apply -f svc-front.yaml  
    kubectl apply -f svc.yaml
    

测试验证

部署opentelemetry-demo

  • 配置OTEL_COLLECTOR_NAME指向部署的opentelemetry-collector

  • 执行部署

    helm install otel-demo . -n observe
    

验证效果

真实流量接入

配置java agent

  • 在目标监控程序中增加Java参数

        - '-javaagent:/sidecar/agent/opentelemetry-javaagent.jar'
        - '-Dotel.resource.attributes=service.name=item-svc'
        - '-Dotel.traces.exporter=otlp'
        - '-Dotel.metrics.exporter=otlp'
    

访问控制

创建ingress

  • grafana 的ingress 已经创建
  • obui/obfront的ingress由deploy/obui下的配置文件生成

配置域名

  • 对于ingress-nginx绑定的主机ip, 将域名绑定到这些ip

资源估算

服务 CPU Mem 存储
clickhouse 4 8 200G
tempo 4 8 200G
otel-collector 3 6 0
prometheus 2 4 100G
grafana 2 4 30G
obui/front 2 2 0
otel-demo 4 8 0
总计 21核 40G 530G

资源实际使用

服务 CPU Mem 存储
clickhouse 4 8 200G
clickhouse-zookeeper 0.25/0.5
tempo 4 8 200G
otel-collector 3 6 0
prometheus 2 4 100G
grafana 2 4 30G
obui/front 2 2 0
otel-demo 4 8 0
总计 21核 40G 530G

租户名称: observe

问题

  • [x] docker hub的地址,push

  • [x] ingress class和storageclass名称

  • [ ] 域名转发到ingress上,ingress创建不了

  • [ ] prometheus mustFromJson