Ad Widget

Collapse

Template "Kubernetes nodes by HTTP" fails to discover

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Marco Gastreghini
    Junior Member
    • Mar 2021
    • 4

    #1

    Template "Kubernetes nodes by HTTP" fails to discover

    I installed the "Kubernetes nodes by HTTP" Template on Zabbix 6.0.3, but I can't get it to work because the Kubernetes discovery doesn't start.

    I created a node for the k8s cluster and I also filled in correctly the macros {$ KUBE.API.ENDPOINT.URL} and {$ KUBE.API.TOKEN}.

    In the Zabbix server log there are these messages:
    332304: 20220825: 102300.961 [Kubernetes] ERROR: Error: cannot get URL: Couldn't connect to server.
    332280: 20220825: 102300.964 [Kubernetes discovery] ERROR: Incorrect JSON. Check debug log for more information.
    332280: 20220825: 102300.965 [Kubernetes discovery] ERROR: Incorrect JSON. Check debug log for more information.

    I don't understand why the Zabbix server can't contact the kubernetes cluster.

    Thanks in advance.
    MG
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    Connection issues? Can you connect from command line with curl?

    Comment

    • Marco Gastreghini
      Junior Member
      • Mar 2021
      • 4

      #3
      OK. Wrong Kubernetes API Endpoint IP... Sorry.

      But now error messages change:
      332304:20220825:150000.560 [ Kubernetes ] ERROR: Request failed with status code 403: {"kind":"Status","apiVersion":"v1","metadata":{ }," status":"Failure","message":"forbidden: User "system:serviceaccount:monitoring:zabbix-service-account" cannot get path "/v1/nodes"","reason":"Forbidden","details":{},"code": 403}
      332280:20220825:150000.562 [ Kubernetes discovery ] ERROR: Incorrect JSON. Check debug log for more information.
      332280:20220825:150000.563 [ Kubernetes discovery ] ERROR: Incorrect JSON. Check debug log for more information.

      Thanks
      MG

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #4
        That looks more like a permission issue on Kubernetes side... http 403 is "Forbidden".
        Do you really have username like "system:serviceaccount:monitoring:zabbix-service-account" ? Or maybe just part of it?

        Comment

        • Marco Gastreghini
          Junior Member
          • Mar 2021
          • 4

          #5
          RESOLVED: wrong string in Macro {$KUBE.API.ENDPOINT.URL} without /api on tail.

          Many thanks
          MG

          Comment

          Working...