部署的helm和manifest

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

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