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试试

      5 天 后

      求助,更换xpack外置ES出现问题

      背景:集群创建时,我先使用了内置ES。后需要改成带xpack的外置ES。
      1.我在cc中增加了如下配置

      2.打开集群设置的日志收集器发现并没有发生变化,还是内置ES地址

      3.随即我删除了这个收集器,打算自己新增,但是发现并没有密码框

      4.不输入账号密码的情况下,fluent-bit.conf配置文件中没有密码 ,fluent-bit pod报错未认证


      5.随即我修改了output,增加了账号密码

      然后:fluent-bit.conf依然没有增加账号密码的配置,并且我按照fluent手册中手动加入HTTP_User & HTTP_Passwd
      更新后配置文件自动还原。

      请问我该进行什么操作呢?

        niutendo
        我刚才通过kubectl -n kubesphere-system get cm kubesphere-config -oyaml 检查到我的password输成passwork了。更新了一下cc,kubesphere-config 已经正常。通过界面去查询日志也已经不提示报错了。看来就剩下fluent-bit.conf中配置如何生效的问题了。

          niutendo 1 如果配置完毕后账户名密码不在output中,需要删除对应status重启ks-installer;
          2 配置完毕发现账户名密码已经注入了,toolbox无法查询数据,要把ks-apiserver重启一下。

            zhu733756
            不好意思,没明白对应status是什么意思。

            我删除了日志收集器中的ES配置,重启了installer pod,发现并没自动创建出日志收集器呢。

              niutendo

              日志收集器中的ES配置不必删除啊
              我说的status参考如下:

              kubectl -n kubesphere-system edit cc ks-installer 

              参考:
              https://github.com/kubesphere/ks-installer/blob/master/playbooks/logging.yaml#L9

                1 个月 后