部署的helm和manifest

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

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