zabbix

by aeciopires

Helm chartv8.0.1App 8.0.0Verified publisher

Zabbix is a mature and effortless enterprise-class open source monitoring solution for network monitoring and application monitoring of millions of metrics.

About this chart

Helm chart for Zabbix

Zabbix is a mature and effortless enterprise-class open source monitoring solution for network monitoring and application monitoring of millions of metrics.

This Helm chart installs Zabbix in a Kubernetes cluster. It supports only Postgresql/TimescaleDB as a database backend at this point in time, without any plans to extend database support towards MySQL, MariaDB, etc. Also, this Helm Chart supports Zabbix Server High Availability

Table of Contents

  • Helm chart for Zabbix
  • Table of Contents
  • Prerequisites
  • Installation
    • Installation from the OCI registry
  • How to access Zabbix
  • Troubleshooting
  • Uninstallation
  • Breaking changes of this helm chart
    • Version 8.0.0
    • Version 7.0.0
    • Version 6.1.0
    • Version 6.0.0
    • Version 5.0.0
    • Version 4.0.0
    • Version 3.0.0
    • Version 2.0.0
    • Version 1.0.0
  • Zabbix components
    • Zabbix Server
    • Zabbix Agent
    • Zabbix Web (frontend)
    • Zabbix Web Service
    • Zabbix Proxy
    • PostgreSQL
  • Thanks
  • License
  • Configuration
    • Helm Values
    • Database access settings
    • Postgresql database
    • Native Zabbix Server High Availability
    • Expose Zabbix service
    • Multiple replicas for Zabbix Proxy statefulset

Prerequisites

  • Kubernetes cluster 1.34+
  • Helm 4.0+
  • Kubectl
  • PV provisioner support in the underlying infrastructure (optional).
  • PostgreSQL 15 to 18, optionally with TimescaleDB 2.20 to 2.29, according to the requirements of Zabbix 8.0. The default is PostgreSQL 18.

Install the kubectl and helm requirements following the instructions in this tutorial.

Installation

[!IMPORTANT] Read the Breaking changes of this helm chart!

Access the Kubernetes cluster.

Add Helm repository:

helm repo add zabbix-community https://zabbix-community.github.io/helm-zabbix

Update the list helm charts available for installation. This is recommend prior to installation/upgrade:

helm repo update

Get all versions of helm chart:

helm search repo zabbix-community/zabbix -l

Set the helm chart version you want to use. Example:

export ZABBIX_CHART_VERSION='8.0.1'

Export default values of zabbix chart to $HOME/zabbix_values.yaml file:

helm show values zabbix-community/zabbix --version $ZABBIX_CHART_VERSION > $HOME/zabbix_values.yaml

Change the values according to the environment in the $HOME/zabbix_values.yaml file. The items of Configuration section can be set via --set flag in installation command or change the values according to the need of the environment in $HOME/zabbix_values.yaml file.

Test the installation/upgrade with the command:

helm upgrade --install zabbix zabbix-community/zabbix \
 --dependency-update \
 --create-namespace \
 --version $ZABBIX_CHART_VERSION \
 -f $HOME/zabbix_values.yaml -n monitoring --debug --dry-run=client

Install/upgrade Zabbix with the command:

helm upgrade --install zabbix zabbix-community/zabbix \
 --dependency-update \
 --create-namespace \
 --version $ZABBIX_CHART_VERSION \
 -f $HOME/zabbix_values.yaml -n monitoring --debug

See the installation example in kind cluster in this tutorial.

Installation from the OCI registry

The chart is also published as an OCI artifact in oci://ghcr.io/zabbix-community/charts/zabbix, useful for registry mirrors and air-gapped environments. No helm repo add is needed:

helm show values oci://ghcr.io/zabbix-community/charts/zabbix --version $ZABBIX_CHART_VERSION > $HOME/zabbix_values.yaml

helm upgrade --install zabbix oci://ghcr.io/zabbix-community/charts/zabbix \
 --create-namespace \
 --version $ZABBIX_CHART_VERSION \
 -f $HOME/zabbix_values.yaml -n monitoring --debug

The OCI registry has the versions released after the publication in it began; older versions are only in the Helm repository https://zabbix-community.github.io/helm-zabbix.

How to access Zabbix

Create port-forward for Zabbix:

kubectl port-forward service/zabbix-zabbix-web 8888:80 -n monitoring

Login to Zabbix:

  • URL: http://localhost:8888
  • Login: Admin
  • Password: zabbix

Troubleshooting

See the pods:

kubectl get pods -n monitoring

See details for each pod:

kubectl describe pods/POD_NAME -n monitoring

See all containers in the pod:

kubectl get pods POD_NAME -n monitoring -o jsonpath='{.spec.containers[*].name}*'

See the logs for each container in the pod:

kubectl logs -f pods/POD_NAME -c CONTAINER_NAME -n monitoring

Access the container prompt.

kubectl exec -it pods/POD_NAME -c CONTAINER_NAME -n monitoring -- sh

See details of Zabbix services.

kubectl get svc -n monitoring
kubectl get pods --output=wide -n monitoring
kubectl describe services zabbix -n monitoring

Uninstallation

To uninstall/delete the zabbix deployment:

helm uninstall zabbix -n monitoring

Breaking changes of this helm chart

Version 8.0.0

[!CAUTION] Back up your database before upgrading. The upgrade from Zabbix 7.x to 8.0 changes the database schema and can't be undone, and Zabbix Server takes time to finish it on large databases. See the Zabbix upgrade notes.

[!WARNING] helm upgrade from a previous version fails with StatefulSet.apps "..." is invalid: spec: Forbidden: updates to statefulset spec for fields other than ... if postgresql.enabled=true or zabbixProxy.enabled=true. The serviceName of the StatefulSets of PostgreSQL and Zabbix Proxy changed and Kubernetes doesn't allow to change it. Before upgrading, delete only the StatefulSets and keep their pods and volumes with --cascade=orphan. The new StatefulSets adopt the pods and the PVCs and replace the pods during the upgrade:

kubectl delete statefulset -n monitoring --cascade=orphan zabbix-postgresql zabbix-zabbix-proxy
helm upgrade zabbix zabbix-community/zabbix --version 8.0.0 -n monitoring -f values.yaml

Change monitoring to your namespace and zabbix to the name of your release. The StatefulSets are named <release>-postgresql and <release>-zabbix-proxy (if fullnameOverride is set, <fullnameOverride>-postgresql and <fullnameOverride>-zabbix-proxy); skip the ones that don't exist in your release.

  • This chart supports Zabbix 8.0, which is the new default of zabbixImageTag (ubuntu-8.0.0). Older versions of Zabbix are not supported or tested anymore. If you set zabbixImageTag or image.tag of any component in your values.yaml, change them to a Zabbix 8.0 tag.
  • This chart requires Kubernetes 1.34 or newer, enforced by kubeVersion in Chart.yaml, and it is tested only with Helm 4.
  • Zabbix 8.0 requires PostgreSQL 15 to 18 and TimescaleDB 2.20 to 2.29. Only PostgreSQL is supported, as before.
  • The default image of postgresql.image.tag and zabbixServer.haNodesAutoClean.image.tag changed from 16 to 18. PostgreSQL 18 can't start with the data of an older major version. If you use postgresql.enabled=true with persistence, before upgrading choose one of these options:
    • keep your current version by setting postgresql.image.tag in your values.yaml, if it is between 15 and 18;
    • migrate the data with pg_dump and pg_restore to a new volume.
  • The images of Zabbix 8.0 have a new compiled entrypoint, which changed how some variables are used by this chart:
    • zabbixProxy.ZBX_SERVER_PORT is now sent to the proxy in ZBX_SERVER_HOST, as host:port, only in active mode (ZBX_PROXYMODE: 0). In the chart 8.0.0, the port was also appended in passive mode, and the passive proxy didn't start;
    • zabbixProxy.ZBX_JAVAGATEWAY_ENABLE now configures the proxy to use the Java Gateway of this chart, with the new value zabbixJavaGateway.ZBX_STARTJAVAPOLLERS;
    • zabbixJavaGateway.ZABBIX_OPTIONS was removed, because the image doesn't use it anymore.
  • The default of zabbixProxy.ZBX_DEBUGLEVEL changed from 4 to 3, because the Zabbix Proxy process of the alpine-8.0.0 image crashes and restarts in a loop with debug level 4. The ubuntu-8.0.0 image doesn't have this problem.
  • The StatefulSets of PostgreSQL and Zabbix Proxy now use the new headless Services <release>-postgresql-headless and <release>-zabbix-proxy-headless in serviceName. Before, they pointed to a Service that doesn't exist. Each pod now has a stable DNS name, such as <release>-zabbix-proxy-0.<release>-zabbix-proxy-headless.<namespace>.svc. See the warning above to upgrade.
  • These errors in the templates were fixed and can change the behavior of your release:
    • Zabbix Server now uses the correct Service of the Java Gateway (<release>-java-gateway) and starts zabbixJavaGateway.ZBX_STARTJAVAPOLLERS Java pollers;
    • the HA Labels sidecar is now deployed when Zabbix Server HA is enabled, even with zabbixAgent.runAsSidecar=false or zabbixAgent.enabled=false;
    • podAntiAffinity of Zabbix Web, Web Service, Java Gateway and WebDriver now selects the correct pods, so their replicas are really spread over the nodes;
    • ZBX_WEBDRIVERURL is now only set when zabbixBrowserMonitoring.enabled=true;
    • the <release>-db-access Secret now always follows postgresAccess and, without postgresAccess.password, keeps the password generated in the first installation;
    • extraInitContainers, extraContainers, jobLabels and image.pullSecrets of the database job, and extraEnv and image.pullSecrets of zabbixServer.haNodesAutoClean, now work.

Version 7.0.0

[!CAUTION] Re-installation of your Release will be necessary. Make sure you do not lose any data!

  • Changed values under postgresAccess, partially made necessary by changing db-create-upgrade-job for Native Zabbix Server High Availability to be a pre-install/pre-upgrade job:
    • removed postgresAccess.useUnifiedSecret. It's now ALWAYS a unified secret containing DB connection relevant settings that is used by all components of this Chart requiring a DB connection
    • unifiedSecretName now called existingSecretName to be more compliant with other Helm Charts
    • unifiedSecretAutoCreate has been removed. Secret generation now depends on having set existingSecretName
    • unifiedSecretXXXKey renamed to simpler secretXXXKey value names
  • Default settings in values.yaml are now postgresql.enabled=true (no change here) and zabbixServer.zabbixServerHA=false (changed, due to Native Zabbix Server High Availability)
  • All labels of all manifests have been unified to fulfill the best practices / standards of how a newly created helm chart (helm create...) would do it. This results in you having to uninstall and install your Release again, as spec.selector label matchers are immutable for Deployments, Statefulsets and such. If you use postgresql.enabled=true ("internal database"), be careful not to delete your Zabbix database when issuing uninstallation. By default, Helm does not remove PersistentVolumeClaims when uninstalling a release, but to be sure, you can annotate your PVC additionally to prevent its deletion
  • Removed all pre 1.21 Kubernetes compatibility switches (v1beta1, ...)
  • deploymentAnnotations have been renamed to extraDeploymentAnnotations for every of the components of this helm chart in values.yaml
  • deploymentLabels have been renamed to extraDeploymentLabels for every of the components of this helm chart in values.yaml. The same counts for statefulSetLabels, etc.
  • deploymentAnnotations have been renamed to extraDeploymentAnnotations for every of the components of this helm chart in values.yaml. The same counts for statefulSetAnnotations, daemonSetAnnotations, etc.
  • containerLabels are now called extraPodLabels and containerAnnotations went to be extraPodAnnotations, as these names match better to

Deploy zabbix with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has zabbix on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartzabbix is pinned at v8.0.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply