Ad Widget

Collapse

zabbix-web-nginx-mysql on talos cluster 502 bad gateway

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mfuk
    Junior Member
    • Jul 2023
    • 16

    #1

    zabbix-web-nginx-mysql on talos cluster 502 bad gateway

    Hi,
    I'm trying to deploy zabbix in Talos k8s.

    I tested the yam file on my local machine using microk8s and works fine, but when I try to deploy in Talos, the zabbix-web-nginx-mysql fails to start with these errorrs:
    Code:
    $ kubectl logs -f pod/zabbix-web-0 -n mon-zabbix-dev
    ** Deploying Zabbix web-interface (Nginx) with MySQL database
    ** Using MYSQL_USER variable from ENV
    ** Using MYSQL_PASSWORD variable from ENV
    ********************
    * DB_SERVER_HOST: galera-0
    * DB_SERVER_PORT: 3306
    * DB_SERVER_DBNAME: zabbix
    ********************
    ** Adding Zabbix virtual host (HTTP)
    **** Impossible to enable SSL support for Nginx. Certificates are missed.
    ** Preparing Zabbix frontend configuration file
    ########################################################
    ** Executing supervisord
    2024-12-18 10:29:44,140 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
    2024-12-18 10:29:44,140 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
    2024-12-18 10:29:44,140 INFO Included extra file "/etc/supervisor/conf.d/supervisord_zabbix.conf" during parsing
    2024-12-18 10:29:44,140 INFO Included extra file "/etc/supervisor/conf.d/supervisord_zabbix.conf" during parsing
    2024-12-18 10:29:44,146 INFO RPC interface 'supervisor' initialized
    2024-12-18 10:29:44,146 INFO RPC interface 'supervisor' initialized
    2024-12-18 10:29:44,147 INFO supervisord started with pid 1
    2024-12-18 10:29:44,147 INFO supervisord started with pid 1
    2024-12-18 10:29:45,149 INFO spawned: 'nginx' with pid 774
    2024-12-18 10:29:45,149 INFO spawned: 'nginx' with pid 774
    2024-12-18 10:29:45,155 INFO spawned: 'php-fpm8.3' with pid 775
    2024-12-18 10:29:45,155 INFO spawned: 'php-fpm8.3' with pid 775
    2024-12-18 10:29:45,220 WARN exited: php-fpm8.3 (terminated by SIGBUS; not expected)
    2024-12-18 10:29:45,220 WARN exited: php-fpm8.3 (terminated by SIGBUS; not expected)
    2024-12-18 10:29:46,223 INFO spawned: 'php-fpm8.3' with pid 781
    2024-12-18 10:29:46,223 INFO spawned: 'php-fpm8.3' with pid 781
    2024-12-18 10:29:46,255 WARN exited: php-fpm8.3 (terminated by SIGBUS; not expected)
    2024-12-18 10:29:46,255 WARN exited: php-fpm8.3 (terminated by SIGBUS; not expected)
    2024-12-18 10:29:47,257 INFO success: nginx entered RUNNING state, process has stayed up for > than 2 seconds (startsecs)
    2024-12-18 10:29:47,257 INFO success: nginx entered RUNNING state, process has stayed up for > than 2 seconds (startsecs)
    2024-12-18 10:29:48,260 INFO spawned: 'php-fpm8.3' with pid 782
    2024-12-18 10:29:48,260 INFO spawned: 'php-fpm8.3' with pid 782
    2024-12-18 10:29:48,317 WARN exited: php-fpm8.3 (terminated by SIGBUS; not expected)
    2024-12-18 10:29:48,317 WARN exited: php-fpm8.3 (terminated by SIGBUS; not expected)
    2024-12-18 10:29:51,322 INFO spawned: 'php-fpm8.3' with pid 791
    2024-12-18 10:29:51,322 INFO spawned: 'php-fpm8.3' with pid 791
    2024-12-18 10:29:51,357 WARN exited: php-fpm8.3 (terminated by SIGBUS; not expected)
    2024-12-18 10:29:51,357 WARN exited: php-fpm8.3 (terminated by SIGBUS; not expected)
    2024-12-18 10:29:52,359 INFO gave up: php-fpm8.3 entered FATAL state, too many start retries too quickly
    2024-12-18 10:29:52,359 INFO gave up: php-fpm8.3 entered FATAL state, too many start retries too quickly
    2024/12/18 10:30:00 [crit] 777#777: *1 connect() to unix:/tmp/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: ::1, server: zabbix, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "localhost:8080"
    ::1 - - [18/Dec/2024:10:30:00 +0000] "GET / HTTP/1.1" 502 166 "-" "curl/8.5.0" "-"
    2024/12/18 10:30:02 [crit] 779#779: *3 connect() to unix:/tmp/php-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: ::1, server: zabbix, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/tmp/php-fpm.sock:", host: "localhost:8080"
    ::1 - - [18/Dec/2024:10:30:02 +0000] "GET / HTTP/1.1" 502 166 "-" "curl/8.5.0" "-"
    If I check inside the pod I receive the error:
    Code:
    root@zabbix-web-0:/usr/share/zabbix# curl http://localhost:8080
    <html>
    <head><title>502 Bad Gateway</title></head>
    <body>
    <center><h1>502 Bad Gateway</h1></center>
    <hr><center>nginx/1.24.0 (Ubuntu)</center>
    </body>
    </html>​
    this is my yaml file:
    Code:
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: zabbix-web
      labels:
        name: zabbix
      namespace: mon-zabbix-dev
    spec:
      type: NodePort
      ports:
      - protocol: TCP
        port: 8080
        targetPort: 8080
        nodePort: 30800
        name: web-http
      selector:
        name: zabbix-web
      sessionAffinity: None
    ---
    apiVersion: apps/v1
    kind: StatefulSet
    metadata:
      namespace: mon-zabbix-dev
      name: zabbix-web
      labels:
        name: zabbix-web
        tier: zabbix-web
    spec:
      serviceName: zabbix-web
      replicas: 2
      selector:
        matchLabels:
         name: zabbix-web
      template:
        metadata:
          labels:
            name: zabbix-web
        spec:
          containers:
          - name: zabbix-web
            image: zabbix/zabbix-web-nginx-mysql:ubuntu-7.0-latest
            lifecycle:
              postStart:
                exec:
                  command: [ "sh", "-c", "update-ca-certificates" ]
            ports:
            - containerPort: 8080
              name: web-http
            resources:
              requests:
                cpu: 50m
                memory: 128Mi
              limits:
                cpu: 1
                memory: 256Mi
            readinessProbe:
              httpGet:
                path: /
                port: web-http
                scheme: HTTP
              initialDelaySeconds: 15
              timeoutSeconds: 2
              periodSeconds: 10
              successThreshold: 1
              failureThreshold: 5
            livenessProbe:
              httpGet:
                path: /
                port: web-http
                scheme: HTTP
              initialDelaySeconds: 15
              timeoutSeconds: 2
              periodSeconds: 10
              successThreshold: 1
              failureThreshold: 5
            env:
            - name: MYSQL_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: MARIADB_PASSWORD
                  name: zabbix-db-secrets
            - name: ZBX_SERVER_NAME
              valueFrom:
                configMapKeyRef:
                  key: ZBX_SERVER_NAME
                  name: zabbix-configmap
            - name: POD_INDEX
              valueFrom:
                fieldRef:
                  fieldPath: metadata.labels['apps.kubernetes.io/pod-index']
            - name: DB_SERVER_HOST
              value: galera-$(POD_INDEX)
            - name: MYSQL_USER
              valueFrom:
                configMapKeyRef:
                  key: MARIADB_USER
                  name: zabbix-configmap
            - name: MYSQL_DATABASE
              valueFrom:
                configMapKeyRef:
                  key: MARIADB_DATABASE
                  name: zabbix-configmap
            - name: PHP_TZ
              valueFrom:
                configMapKeyRef:
                  key: PHP_TZ
                  name: zabbix-configmap
            securityContext:
              runAsUser: 0
              allowPrivilegeEscalation: false
          restartPolicy: Always​
    any idea, how can fix it?
    thanks for the support
    Attached Files
Working...