zabbix
by aeciopires
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 upgradefrom a previous version fails withStatefulSet.apps "..." is invalid: spec: Forbidden: updates to statefulset spec for fields other than ...ifpostgresql.enabled=trueorzabbixProxy.enabled=true. TheserviceNameof 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.yamlChange
monitoringto your namespace andzabbixto the name of your release. The StatefulSets are named<release>-postgresqland<release>-zabbix-proxy(iffullnameOverrideis set,<fullnameOverride>-postgresqland<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 setzabbixImageTagorimage.tagof any component in yourvalues.yaml, change them to a Zabbix 8.0 tag. - This chart requires Kubernetes 1.34 or newer, enforced by
kubeVersioninChart.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.tagandzabbixServer.haNodesAutoClean.image.tagchanged from16to18. PostgreSQL 18 can't start with the data of an older major version. If you usepostgresql.enabled=truewith persistence, before upgrading choose one of these options:- keep your current version by setting
postgresql.image.tagin yourvalues.yaml, if it is between 15 and 18; - migrate the data with
pg_dumpandpg_restoreto a new volume.
- keep your current version by setting
- The images of Zabbix 8.0 have a new compiled entrypoint, which changed how some variables are used by this chart:
zabbixProxy.ZBX_SERVER_PORTis now sent to the proxy inZBX_SERVER_HOST, ashost: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_ENABLEnow configures the proxy to use the Java Gateway of this chart, with the new valuezabbixJavaGateway.ZBX_STARTJAVAPOLLERS;zabbixJavaGateway.ZABBIX_OPTIONSwas removed, because the image doesn't use it anymore.
- The default of
zabbixProxy.ZBX_DEBUGLEVELchanged from4to3, because the Zabbix Proxy process of thealpine-8.0.0image crashes and restarts in a loop with debug level4. Theubuntu-8.0.0image doesn't have this problem. - The StatefulSets of PostgreSQL and Zabbix Proxy now use the new headless Services
<release>-postgresql-headlessand<release>-zabbix-proxy-headlessinserviceName. 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 startszabbixJavaGateway.ZBX_STARTJAVAPOLLERSJava pollers; - the HA Labels sidecar is now deployed when Zabbix Server HA is enabled, even with
zabbixAgent.runAsSidecar=falseorzabbixAgent.enabled=false; podAntiAffinityof Zabbix Web, Web Service, Java Gateway and WebDriver now selects the correct pods, so their replicas are really spread over the nodes;ZBX_WEBDRIVERURLis now only set whenzabbixBrowserMonitoring.enabled=true;- the
<release>-db-accessSecret now always followspostgresAccessand, withoutpostgresAccess.password, keeps the password generated in the first installation; extraInitContainers,extraContainers,jobLabelsandimage.pullSecretsof the database job, andextraEnvandimage.pullSecretsofzabbixServer.haNodesAutoClean, now work.
- Zabbix Server now uses the correct Service of the Java Gateway (
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 unifiedSecretNamenow calledexistingSecretNameto be more compliant with other Helm ChartsunifiedSecretAutoCreatehas been removed. Secret generation now depends on having setexistingSecretNameunifiedSecretXXXKeyrenamed to simplersecretXXXKeyvalue names
- removed
- Default settings in
values.yamlare nowpostgresql.enabled=true(no change here) andzabbixServer.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, asspec.selectorlabel matchers are immutable for Deployments, Statefulsets and such. If you usepostgresql.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, ...) deploymentAnnotationshave been renamed toextraDeploymentAnnotationsfor every of the components of this helm chart invalues.yamldeploymentLabelshave been renamed toextraDeploymentLabelsfor every of the components of this helm chart invalues.yaml. The same counts forstatefulSetLabels, etc.deploymentAnnotationshave been renamed toextraDeploymentAnnotationsfor every of the components of this helm chart invalues.yaml. The same counts forstatefulSetAnnotations,daemonSetAnnotations, etc.containerLabelsare now calledextraPodLabelsandcontainerAnnotationswent to beextraPodAnnotations, 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartzabbix is pinned at v8.0.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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