Ad Widget

Collapse

Multiple zabbix agents in kubernetes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Vratis
    Junior Member
    • Jun 2023
    • 2

    #1

    Multiple zabbix agents in kubernetes

    Hi everyone,

    Zabbix server - 6.4.3 running on debian 11 server

    I have a kubernetes cluster 3 master and 12 worker nodes. On these worker nodes our hosting team installed zabbix agent (so a linux service directly on server) some time ago and they use it to monitor if servers are up, cpu, memory etc.. (basic stuff).
    This zabbix linux agent is currently using default port 10050. Later we decided to create a new zabbix server for our kubernetes team to monitor all our clusters and also all thing kubernetes related which linux agent cant see. So I wanted to install it via helm chart provided by zabbix which includes proxy and also an agent.

    Of course agents did not start complaining that default port 10050 is already in use by something else (linux zabbix agent).
    I know that I need to change my kubernetes zabbix agent port but everything i try does not work for some reason.
    Linux agent have its own config where I can see port which agent will use. But I cant find a way to do the same with agent in kubernetes.

    I changed values.yaml for agent to use port 10055 which is free instead of default one

    zabbixAgent:
    service:
    type: ClusterIP
    port: 10055
    targetPort: 10055
    nodePort: 10055
    portName: zabbix-agent

    Still after deploying helm chart with these values it will not do anything and wants to deploy agents to each node with port 10050 which results in pod not starting. After deployment I also via Rancher changed port mapping for zabbix agent publish container port to 10055 and listening port 10055.
    After this change it changes endpoint to http://nodeIP:10055 but still agent pod will not start and in logs says it cant start because 10050 is already taken.
    Not sure where I need to this change but everything I tried seems to be ignored by agent pod which wants to use only default one.
    And of course i do not want to change already running linux agent service.

    Any help appreciated.​
  • Vratis
    Junior Member
    • Jun 2023
    • 2

    #2
    If someone ended here with similar problem I just want to write here that I never resolved this the way I wanted. I just could not get zabbix agent pod to start since since after everything I changed it still wanted default port to be free (even if agent service was exposed on different port). I also tried older zabbix helm charts. Installed via helm CLI and via Rancher (tried two Rancher versions - older and newest) - still same behavior.

    There are two ways to workaround this:

    1 use agent in active mode instead of passive that way port 10050 is not needed for agent and should work

    or

    2 change existing linux agent listening port from default to different one (changed listening port in config, restarted agent service and worked immediately) - this is the solution that I wanted to avoid but ended up doing as easiest solution. Then i installed zabbix helm chart with default port 10050.

    Comment

    • swinters
      Junior Member
      • Dec 2023
      • 1

      #3
      Wanted to add that you can modify the kubernetes agent port by adding a
      - name: ZBX_LISTENPORT
      value: 10055​
      variable to the zabbix_values.yaml default chart values file under
      zabbixAgent:
      env:
      Example:
      zabbixAgent:
      env:​
      - name: ZBX_LISTENPORT
      value: 10055​​

      Comment

      Working...