zabbix-community / helm-zabbix

Helm chart for Zabbix
https://artifacthub.io/packages/helm/zabbix-community/zabbix
Apache License 2.0
77 stars 45 forks source link

[zabbix-community/zabbix] Make Zabbix HA great again! #86

Closed thomas-korrison closed 2 weeks ago

thomas-korrison commented 2 months ago

Hi all, I have been looking to deploy Zabbix in HA mode with this helm chart but have been unsuccessful. Although multiple pods do get deployed in active/standby mode respectively, the web server is unable to detect the active pod, so the ui complains about the server not being available.

I have managed to get it all to work by deploying the Zabbix server as a StatefulSet and using a headless service for service discovery. As I understand it, when you use a headless service with a StatefulSet, each pod gets a unique DNS subdomain, which resolves directly to the pod’s IP address.

This DNS is typically structured as [podname].[headless-service-name].[namespace].svc.cluster.local.

See this issue for more details. zabbix/zabbix-docker/issues/931

Describe the solution you'd like Enable HA mode by

  1. deploying the Zabbix server as a stateful set
  2. Add a headless service for service discovery
  3. modify environmental variables as appropriate

Describe alternatives you've considered

  1. adding a leader election sidecar (sounds hacky)
aeciopires commented 1 month ago

Hi @thomas-korrison!

Unfortunately I don't have the knowledge to implement this, but if you do, I would really like to see a Pull Request about this and incorporate it into the helm chart.

I linked this issue to @sa-ChristianAnton, but I don't know if he will have the free time to implement it.

thomas-korrison commented 1 month ago

Thanks for the reply @aeciopires !

Yes, I think I can make a pull request with the relevant changes. Just wanted to gauge interest first before implementing anything.

aeciopires commented 1 month ago

Excellent @thomas-korrison!

I will really enjoy evaluating and testing your Pull Request. I wish you great research and implementation work.

In the next few days I should release another version of the helm chart containing changes from a Pull Request that was opened today and a small refactory that I think is necessary in the services objects and extraEnv config. It's good to keep an eye on synchronizing code and avoiding conflicts.

aeciopires commented 1 month ago

In time, Zabbix 7.0 is in release candidate. I think the final version should be out in a few weeks.

Looking at the release notes, I saw that Zabbix 7.0 has a feature related to this and I saw that we will need to change a lot in the helm chart to support the new version, as well as a new PostgreSQL, TimeScaleDB, etc... It might be interesting to wait for these releases to avoid rework... What do you think?

References:

thomas-korrison commented 1 month ago

yes, it is probably wise to wait, if lots of changes are going to happen over the next few weeks

aeciopires commented 1 month ago

Hello @thomas-korrison!

I published the new version of helm chart (5.0.0) to add support Zabbix 7.0.0. More details: https://github.com/zabbix-community/helm-zabbix/pull/96

Now you can begin the tests and work to implement this feature if necessary.

Have a nice week!

Nyralei commented 1 month ago

+1 for running zabbix-server as statefulset

thomas-korrison commented 3 weeks ago

I just did a deployment from the latest helm chart on minikube and it appears the HA mode works without any updates needed! If someone else can confirm this, we can probably close this issue.