Add extraContainers support to Zabbix Proxy in Kubernetes Helm chart

XMLWordPrintable

    • Type: Patch request
    • Resolution: Unresolved
    • Priority: Major
    • None
    • Affects Version/s: 6.0.45, 7.0.24, 7.4.8, 8.0.0alpha2
    • Component/s: None
    • Support backlog
    • 1

      The zabbix-proxy template in the Kubernetes Helm chart does not support adding sidecar containers via extraContainers configuration, unlike other components (zabbix-server, zabbix-agent).

        This enhancement adds support for defining extra containers in the proxy pod, enabling use cases like:
        - Running Zabbix Agent 2 as a sidecar for direct database monitoring
        - Adding auxiliary monitoring containers
        - Extending proxy functionality without separate deployments

        CHANGES:
        1. Modified: templates/zabbix-proxy.yaml
           - Added: {{- if .Values.zabbixProxy.extraContainers }} block after main container definition
           - Allows rendering additional containers defined in values.yaml

        2. Modified: values.yaml
           - Added: zabbixProxy.extraContainers field (default empty array)
           - Added: Documentation with example for Agent2 sidecar

        EXAMPLE USE CASE:
        Monitoring CloudNativePG PostgreSQL directly via Agent2 sidecar:

        zabbixProxy: 
          extraContainers: 
          - name: zabbix-agent2
            image: zabbix/zabbix-agent2:alpine-7.0.17
            ports: 
            - containerPort: 10050
            env: 
            - name: ZBX_HOSTNAME
              value: "pg-monitor-agent"
            - name: ZBX_SERVER_ACTIVE
              value: "localhost:10051"
      

      BENEFITS:
        - Eliminates need for separate agent deployments
        - Simplifies proxy pod architecture
        - Consistency with other Helm chart components
        - Enables advanced monitoring scenarios with minimal complexity

        PATCH ATTACHED:

      === File 1: templates/zabbix-proxy.yaml ===

      
        @@ -73,6 +73,9 @@ spec: 
                       value: "5"
                     \{{- end }}
                     \{{- end }}
        +      \{{- if .Values.zabbixProxy.extraContainers }}
        +\{{ toYaml .Values.zabbixProxy.extraContainers | indent 8 }}
        +      \{{- end }}
               \{{- if .Values.zabbixProxy.image.pullSecrets }}
               imagePullSecrets: 
         \{{ toYaml .Values.zabbixProxy.image.pullSecrets | indent 6 }}
      

        === File 2: values.yaml ===

      
        @@ -187,6 +187,21 @@ zabbixProxy: 
             ##
             subPath: ""
      
        +  ## Extra containers to add to Zabbix proxy pod (e.g., sidecars for monitoring)
        +  ## Example: add Zabbix Agent2 sidecar for PostgreSQL monitoring
        +  ## extraContainers: 
        +  ##   - name: zabbix-agent2
        +  ##     image: zabbix/zabbix-agent2:alpine-7.0.17
        +  ##     ports: 
        +  ##       - containerPort: 10050
        +  ##         name: zabbix-agent
        +  ##     env: 
        +  ##       - name: ZBX_HOSTNAME
        +  ##         value: "cnpg-monitor-agent"
        +  ##       - name: ZBX_SERVER_ACTIVE
        +  ##         value: "localhost:10051"
        +  extraContainers: []
        +
         ## **Zabbix agent** configurations
         zabbixAgent: 
           ## Enable use of Zabbix agent
      

        Summary of changes:
        - Templates/zabbix-proxy.yaml: Added 3 lines to render extraContainers after the main proxy container
        - values.yaml: Added extraContainers: [] field with documentation and example for Agent2 sidecar

        Both changes are minimal, non-breaking (default empty array), and follow existing patterns in the chart (like zabbixServer.extraContainers).

            Assignee:
            Zabbix Integration Team
            Reporter:
            Zohair Raza
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: