Skip to content

Commit

Permalink
Merge pull request #7 from aeciopires/fix-issues
Browse files Browse the repository at this point in the history
Fix issues #4 and #5 - Improvements in helm chart
  • Loading branch information
sa-ChristianAnton authored Oct 10, 2022
2 parents 87493a0 + 337fddc commit 216fac3
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 16 deletions.
4 changes: 2 additions & 2 deletions charts/zabbix/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
apiVersion: v2
name: zabbix
version: 3.2.2
version: 3.3.0
# LTS Zabbix version by default due to stability. See: https://www.zabbix.com/life_cycle_and_release_policy
appVersion: 6.0.8
appVersion: 6.0.9
description: Zabbix is a mature and effortless enterprise-class open source monitoring solution for network monitoring and application monitoring of millions of metrics.
keywords:
- zabbix
Expand Down
14 changes: 10 additions & 4 deletions charts/zabbix/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Helm chart for Zabbix.

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Version: 3.2.2](https://img.shields.io/badge/Version-3.2.2-informational?style=flat-square)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ![Version: 3.3.0](https://img.shields.io/badge/Version-3.3.0-informational?style=flat-square)

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

Expand Down Expand Up @@ -386,7 +386,7 @@ The following tables lists the configurable parameters of the chart and their de
| route.hostName | string | `"chart-example.local"` | Host Name for the route. Can be left empty |
| route.tls | object | `{"termination":"edge"}` | Openshift Route TLS settings |
| tolerations | list | `[]` | Tolerations configurations |
| zabbix_image_tag | string | `"ubuntu-6.0.8"` | Zabbix components (server, agent, web frontend, ...) image tag to use. This helm chart is compatible with non-LTS version of Zabbix, that include important changes and functionalities. But by default this helm chart will install the latest LTS version (example: 6.0.x). See more info in [Zabbix Life Cycle & Release Policy](https://www.zabbix.com/life_cycle_and_release_policy) page When you want use a non-LTS version (example: 6.2.x), you have to set this yourself. You can change version here or overwrite in each component (example: zabbixserver.image.tag, etc). |
| zabbix_image_tag | string | `"ubuntu-6.0.9"` | Zabbix components (server, agent, web frontend, ...) image tag to use. This helm chart is compatible with non-LTS version of Zabbix, that include important changes and functionalities. But by default this helm chart will install the latest LTS version (example: 6.0.x). See more info in [Zabbix Life Cycle & Release Policy](https://www.zabbix.com/life_cycle_and_release_policy) page When you want use a non-LTS version (example: 6.2.x), you have to set this yourself. You can change version here or overwrite in each component (example: zabbixserver.image.tag, etc). |
| zabbixagent.ZBX_ACTIVE_ALLOW | bool | `true` | This variable is boolean (true or false) and enables or disables feature of active checks |
| zabbixagent.ZBX_JAVAGATEWAY_ENABLE | bool | `false` | The variable enable communication with Zabbix Java Gateway to collect Java related checks. By default, value is false. |
| zabbixagent.ZBX_PASSIVESERVERS | string | `"127.0.0.1"` | The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container. |
Expand Down Expand Up @@ -437,9 +437,15 @@ The following tables lists the configurable parameters of the chart and their de
| zabbixserver.extraPodSpecs | object | `{}` | additional specifications to the zabbix server pod |
| zabbixserver.extraVolumeMounts | list | `[]` | additional volumeMounts to the zabbix server container |
| zabbixserver.extraVolumes | list | `[]` | additional volumes to make available to the zabbix server pod |
| zabbixserver.ha_nodes_autoclean | object | `{"delete_older_than_seconds":3600,"enabled":true,"image":{"pullPolicy":"IfNotPresent","pullSecrets":[],"repository":"postgres","tag":"14"},"schedule":"0 1 * * *"}` | automatically clean orphaned ha nodes from ha_nodes db table |
| zabbixserver.ha_nodes_autoclean | object | `{"delete_older_than_seconds":3600,"enabled":true,"extraContainers":[],"extraEnv":[],"extraInitContainers":[],"extraPodSpecs":{},"extraVolumeMounts":[],"extraVolumes":[],"image":{"pullPolicy":"IfNotPresent","pullSecrets":[],"repository":"postgres","tag":"14"},"schedule":"0 1 * * *"}` | automatically clean orphaned ha nodes from ha_nodes db table |
| zabbixserver.ha_nodes_autoclean.extraContainers | list | `[]` | additional containers to start within the cronjob hanodes autoclean |
| zabbixserver.ha_nodes_autoclean.extraEnv | list | `[]` | Extra environment variables. A list of additional environment variables. |
| zabbixserver.ha_nodes_autoclean.extraInitContainers | list | `[]` | additional init containers to start within the cronjob hanodes autoclean |
| zabbixserver.ha_nodes_autoclean.extraPodSpecs | object | `{}` | additional specifications to the cronjob hanodes autoclean |
| zabbixserver.ha_nodes_autoclean.extraVolumeMounts | list | `[]` | additional volumeMounts to the cronjob hanodes autoclean |
| zabbixserver.ha_nodes_autoclean.extraVolumes | list | `[]` | additional volumes to make available to the cronjob hanodes autoclean |
| zabbixserver.hostIP | string | `"0.0.0.0"` | optional set hostIP different from 0.0.0.0 to open port only on this IP |
| zabbixserver.hostPort | bool | `false` | optional set true open a port direct on node where zabbix server runs |
| zabbixserver.hostPort | bool | `false` | optional set true open a port direct on node where zabbix server runs |
| zabbixserver.image.pullPolicy | string | `"IfNotPresent"` | Pull policy of Docker image |
| zabbixserver.image.pullSecrets | list | `[]` | List of dockerconfig secrets names to use when pulling images |
| zabbixserver.image.repository | string | `"zabbix/zabbix-server-pgsql"` | Zabbix server Docker image name |
Expand Down
4 changes: 2 additions & 2 deletions charts/zabbix/docs/example/kind/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Custom values for zabbix.

zabbix_image_tag: alpine-6.2.2
zabbix_image_tag: alpine-6.2.3

db_access:
# central place for all database related parameters (db name, host, user, password) in one secret
Expand Down Expand Up @@ -65,7 +65,7 @@ zabbixagent:
ZBX_SERVER_HOST: 127.0.0.1
ZBX_SERVER_PORT: 10051
ZBX_PASSIVE_ALLOW: true # This variable is boolean (true or false) and enables or disables feature of passive checks. By default, value is true
ZBX_PASSIVESERVERS: 127.0.0.1 # The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container.
ZBX_PASSIVESERVERS: 127.0.0.1 # The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container.
ZBX_ACTIVE_ALLOW: true # This variable is boolean (true or false) and enables or disables feature of active checks
#ZBX_ACTIVESERVERS: zabbix-server:10051 #,proxy-zabbix-proxy:10072 # The variable is comma separated list of allowed Zabbix server or proxy hosts for connections to Zabbix agent container. You may specify port.
# ZBX_LOADMODULE: dummy1.so,dummy2.so # The variable is list of comma separated loadable Zabbix modules. It works with volume /var/lib/zabbix/modules.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if gt (.Values.zabbixserver.replicaCount | int) 1 }}
{{- if and .Values.zabbixserver.enabled (gt (.Values.zabbixserver.replicaCount | int) 1) }}
apiVersion: v1
kind: ConfigMap
metadata:
Expand Down
24 changes: 23 additions & 1 deletion charts/zabbix/templates/cronjob-hanodes-autoclean.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.zabbixserver.ha_nodes_autoclean.enabled }}
{{- if and .Values.zabbixserver.enabled .Values.zabbixserver.ha_nodes_autoclean.enabled }}
{{- if .Capabilities.APIVersions.Has "batch/v1/CronJob" }}
apiVersion: batch/v1
{{- else }}
Expand All @@ -19,6 +19,13 @@ spec:
spec:
template:
spec:
{{- with .Values.zabbixserver.ha_nodes_autoclean.extraPodSpecs }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.zabbixserver.ha_nodes_autoclean.extraInitContainers }}
initContainers:
{{- toYaml . | nindent 12 }}
{{- end }}
containers:
- name: hanodes-autoclean
image: {{ .Values.zabbixserver.ha_nodes_autoclean.image.repository }}:{{ .Values.zabbixserver.ha_nodes_autoclean.image.tag }}
Expand All @@ -29,9 +36,24 @@ spec:
- echo "deleting all stopped and unavailable HANodes older than {{ .Values.zabbixserver.ha_nodes_autoclean.delete_older_than_seconds }} seconds..." && psql -c "delete from ha_node where status in (1,2) and extract(epoch from now())-lastaccess>{{ .Values.zabbixserver.ha_nodes_autoclean.delete_older_than_seconds }}"
env:
{{- include "zabbix.db_access.env_vars" (list $ . "db_client") | nindent 12 }}
{{- range $item := .Values.zabbixserver.ha_nodes_autoclean.extraEnv }}
- name: {{ $item.name }}
value: {{ $item.value | quote }}
{{- end }}
{{- with .Values.zabbixserver.ha_nodes_autoclean.extraVolumeMounts }}
volumeMounts:
{{- toYaml . | nindent 14 }}
{{- end }}
{{- with .Values.zabbixserver.ha_nodes_autoclean.extraContainers }}
{{- toYaml . | nindent 10 }}
{{- end }}
imagePullSecrets:
{{- range .Values.zabbixserver.image.pullSecrets }}
- name: {{ . | quote }}
{{- end }}
restartPolicy: OnFailure
{{- with .Values.zabbixserver.ha_nodes_autoclean.extraVolumes }}
volumes:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
2 changes: 1 addition & 1 deletion charts/zabbix/templates/job-init-db-schema.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if gt (.Values.zabbixserver.replicaCount | int) 1 }}
{{- if and .Values.zabbixserver.enabled (gt (.Values.zabbixserver.replicaCount | int) 1) }}
apiVersion: batch/v1
kind: Job
metadata:
Expand Down
22 changes: 17 additions & 5 deletions charts/zabbix/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#See more info in [Zabbix Life Cycle & Release Policy](https://www.zabbix.com/life_cycle_and_release_policy) page
#When you want use a non-LTS version (example: 6.2.x), you have to set this yourself. You can change version
#here or overwrite in each component (example: zabbixserver.image.tag, etc).
zabbix_image_tag: ubuntu-6.0.8
zabbix_image_tag: ubuntu-6.0.9

# **Zabbix DB access / credentials** configurations
# with this dict, you can set unified DB access credentials, IP and so on for both Zabbix server and Zabbix web frontend
Expand All @@ -17,7 +17,7 @@ zabbix_image_tag: ubuntu-6.0.8
db_access:
# under this section you can configure DB access and credentials centrally for the entire helm chart.
# All relevant components installed by this chart will respect it: zabbixserver, zabbixweb and postgresql (if enabled)
#
#
# USING ONE SECRET CONTAINING ALL DB RELEVANT SETTINGS
# DB access details all in one existing secret (matches the structure of secrets the CrunchyData pgo operator generates)
# if this option is chosen the below listed "db_server_*" and "postgres_*" settings are being ignored
Expand Down Expand Up @@ -60,7 +60,7 @@ zabbixserver:
replicaCount: 1
# -- set permissive podAntiAffinity to spread replicas over cluster nodes if replicaCount>1
pod_anti_affinity: true
# -- optional set true open a port direct on node where zabbix server runs
# -- optional set true open a port direct on node where zabbix server runs
hostPort: false
# -- optional set hostIP different from 0.0.0.0 to open port only on this IP
hostIP: 0.0.0.0
Expand All @@ -85,6 +85,18 @@ zabbixserver:
pullSecrets: []
schedule: "0 1 * * *"
delete_older_than_seconds: 3600
# -- Extra environment variables. A list of additional environment variables.
extraEnv: []
# -- additional volumeMounts to the cronjob hanodes autoclean
extraVolumeMounts: []
# -- additional containers to start within the cronjob hanodes autoclean
extraContainers: []
# -- additional init containers to start within the cronjob hanodes autoclean
extraInitContainers: []
# -- additional volumes to make available to the cronjob hanodes autoclean
extraVolumes: []
# -- additional specifications to the cronjob hanodes autoclean
extraPodSpecs: {}
service:
# -- Type of service in Kubernetes cluster
type: ClusterIP
Expand Down Expand Up @@ -138,7 +150,7 @@ postgresql:
# -- Type of service in Kubernetes cluster
type: ClusterIP
# -- Cluster IP for Zabbix server
clusterIP:
clusterIP:
# -- Port of service in Kubernetes cluster
port: 5432
# -- Annotations for the zabbix-server service
Expand Down Expand Up @@ -374,7 +386,7 @@ zabbixwebservice:
# -- Type of service for Zabbix web
type: ClusterIP
# -- Cluster IP for Zabbix web
clusterIP:
clusterIP:
# -- Port to expose service
port: 10053
# -- Annotations for the zabbix-web service
Expand Down

0 comments on commit 216fac3

Please sign in to comment.