部署 Kubesphere 2.1 时,配置文件 common.yaml 中,配置外接 ES ;

logging_enabled: false
elasticsearch_master_replicas: 1
elasticsearch_data_replicas: 2
logsidecar_replicas: 2
elasticsearch_volume_size: 20Gi
log_max_age: 7
elk_prefix: logstash
kibana_enabled: false
external_es_url: https://xxxxxxxxxx
external_es_port: 443
???  any conf else ?

huanggze

#  ES 配置中开启 security
xpack.security.enabled: true

# 命令行创建账号密码
bin/elasticsearch-setup-passwords interactive

    hsdtsyl KubeSphere 日志功能分两部分:日志采集 + 日志查询

    日志采集,由 Fluent Bit 完成,外接 TLS support 的 es,需要修改 Fluent Bit 配置(目前支持)

    日志查询,由 KubeSphere elastic go-client 完成,目前不支持 X-Pack Security,会在后续版本支持

    目前 2.1.0 版本外接商业版 es,能采集日志但可能无法在 KubeSphere UI 上查看。请问是否需要我整理下日志采集配置的文档?

    1 年 后

    huanggze 请问现在3.0版本支持了吗?直接对接外部es带有用户密码的吗?我看指定logging的url没有用户密码参数。

    2 个月 后

    现在还是可以收集到带验证的xpack, ks UI 上还不能从 xpack 里查
    我们看看什么时候可以支持 @wanjunlei

    2 个月 后

    3.0外接ES只需要修改fluent-bit.conf中的配置嘛?是不是意味着ks-install修改了会覆盖这个配置

    3 个月 后

    csz711 外置es xpack需要自己配置,我们的client端设置了账户和密码validation, 在ks-installer里面可以配置。

      zhu733756 可否详细些?ks-installer里面关于es配置只看到了(因为ks3.1自带的es版本太低,所以在其他ns里另搭了一个es)
      ·es:
      elasticsearchDataReplicas: 1
      elasticsearchDataVolumeSize: 20Gi
      elasticsearchMasterReplicas: 1
      elasticsearchMasterVolumeSize: 4Gi
      elkPrefix: logstash
      externalElasticsearchPort: 9200
      externalElasticsearchUrl: elasticsearch-master.ks-logging-system
      logMaxAge: 7

        csz711

        kubectl -n kubesphere-system edit cc ks-installer

        ks官方文档里面也可以找到,你可以先搜搜。

          22 天 后

          zhu733756

          如何配置该日志收集写入到启用了 es-xpack 权限的 es中。

          下面的事件日志和审计日志都可以正常写入到外部启用了 es-xpack 权限的 es中。

          设置的外部url和端口正确吗?
          如果还是无法解决,可以执行下面语句检查添加的账户密码信息

          kubectl -n kubesphere-logging-system get outputs.logging.kubesphere.io es -oyaml
          kubectl -n kubesphere-system get cm kubesphere-config -oyaml

            zhu733756 非常感谢您的回复。
            1、执行 kubectl -n kubesphere-logging-system get outputs.logging.kubesphere.io es -oyaml

            apiVersion: logging.kubesphere.io/v1alpha2
            kind: Output
            metadata:
             ......
             spec:
              es:
                host: 10.1.7.51
                logstashFormat: true
                logstashPrefix: ks-ks-log
                port: 30402
                timeKey: '@timestamp'
              matchRegex: (?:kube|service)\.(.*)

            端口和地址都正确,但是缺少账号密码的信息。
            fluent-bit-w9bkg,的日志报错则是说,没有提供账号密码。

            [2021/07/09 08:49:24] [error] [output:es:es.2] HTTP status=401 URI=/_bulk, response:
            {"error":{"root_cause":[{"type":"security_exception","reason":"missing authentication credentials for REST request [/_bulk]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}}],"type":"security_exception","reason":"missing authentication credentials for REST request [/_bulk]","header":{"WWW-Authenticate":"Basic realm=\"security\" charset=\"UTF-8\""}},"status":401}

            2、执行 kubectl -n kubesphere-system get cm kubesphere-config -oyaml
            这是我的有用输出

              kubesphere.yaml: |
                authentication:
                  authenticateRateLimiterMaxTries: 10
                  authenticateRateLimiterDuration: 10m0s
                  loginHistoryRetentionPeriod: 168h
                  maximumClockSkew: 10s
                  multipleLogin: True
                  kubectlImage: 192.168.101.30/devops/kubesphere/kubectl:v1.19.0
                  jwtSecret: "NdrdmdbcerddelxdsdndrR2ddEBzreV1"
                network:
                  ippoolType: none
                multicluster:
                  enable: true
                  agentImage: 192.168.101.30/devops/kubesphere/tower:v0.2.0
                  proxyPublishService: tower.kubesphere-system.svc
                monitoring:
                  endpoint: http://prometheus-operated.kubesphere-monitoring-system.svc:9090
                events:
                  host: http://10.1.7.51:30402
                  basicAuth: True
                  username: "elastic"
                  password: "elastic"
                  indexPrefix: ks-ks-events
                auditing:
                  enable: true
                  host: http://10.1.7.51:30402
                  basicAuth: True
                  username: "elastic"
                  password: "elastic"
                  indexPrefix: ks-ks-auditing
                alerting:
                  prometheusEndpoint: http://prometheus-operated.kubesphere-monitoring-system.svc:9090
                  thanosRulerEndpoint: http://thanos-ruler-operated.kubesphere-monitoring-system.svc:10902
                  thanosRuleResourceLabels: thanosruler=thanos-ruler,role=thanos-alerting-rules

            没有显示 logging 的账号密码信息,我不知道在哪个位置填。

            output这样改

            es:
               HTTP_USER:
               HTTP_PASSwd:__

            你的这个config文件不完整啊,你重启下installer试试