User Tools

Site Tools


zabbix_deploy

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

zabbix_deploy [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadmzabbix_deploy [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-====== Zabbix Deployment ====== 
-===== Criando a database ===== 
-FIXME **Executar no servidor PostgreSQL** [[install_postgres_ol8|Instalação no Oracle Linux 8]] 
- 
-===== Criando o armazenamento ===== 
- 
-<file bash> 
-$ sudo fdisk -l /dev/sdb 
-Disco /dev/sdb: 256 GiB, 274877906944 bytes, 536870912 setores 
-Unidades: setor de 1 * 512 = 512 bytes 
-Tamanho de setor (lógico/físico): 512 bytes / 512 bytes 
-Tamanho E/S (mínimo/ótimo): 512 bytes / 512 bytes 
-</file> 
- 
-<file bash> 
-$ sudo pvcreate /dev/sdb 
-  Physical volume "/dev/sdb" successfully created. 
-</file> 
- 
-<file bash> 
-$ sudo vgcreate vgPGSQL /dev/sdb 
-  Volume group "vgPGSQL" successfully created 
-</file> 
- 
-<file bash> 
-$ sudo lvcreate -L 128G -n lvZABBIX vgPGSQL 
-  Logical volume "lvZABBIX" created. 
-</file> 
- 
-<file bash> 
-$ sudo pvdisplay /dev/sdb 
-  --- Physical volume --- 
-  PV Name               /dev/sdb 
-  VG Name               vgPGSQL 
-  PV Size               256,00 GiB / not usable 4,00 MiB 
-  Allocatable           yes 
-  PE Size               4,00 MiB 
-  Total PE              65535 
-  Free PE               32767 
-  Allocated PE          32768 
-  PV UUID               OB5eaC-Uh8i-D1Bi-8eny-BP0L-D32I-pLyo1e 
-</file> 
- 
-<file bash> 
-$ sudo vgdisplay vgPGSQL 
-  --- Volume group --- 
-  VG Name               vgPGSQL 
-  System ID 
-  Format                lvm2 
-  Metadata Areas        1 
-  Metadata Sequence No  2 
-  VG Access             read/write 
-  VG Status             resizable 
-  MAX LV                0 
-  Cur LV                1 
-  Open LV               0 
-  Max PV                0 
-  Cur PV                1 
-  Act PV                1 
-  VG Size               <256,00 GiB 
-  PE Size               4,00 MiB 
-  Total PE              65535 
-  Alloc PE / Size       32768 / 128,00 GiB 
-  Free  PE / Size       32767 / <128,00 GiB 
-  VG UUID               uLGkFb-HfjP-2jc5-NAzd-6wkV-jf1p-IMOA5F 
-</file> 
- 
-<file bash> 
-$ sudo lvdisplay /dev/vgPGSQL/lvZABBIX 
-  --- Logical volume --- 
-  LV Path                /dev/vgPGSQL/lvZABBIX 
-  LV Name                lvZABBIX 
-  VG Name                vgPGSQL 
-  LV UUID                eTY2Ei-WtK3-Z97x-7Hbj-vKPc-ly1U-jWhRZi 
-  LV Write Access        read/write 
-  LV Creation host, time pgsql, 2022-06-16 10:24:32 -0300 
-  LV Status              available 
-  # open                 0 
-  LV Size                128,00 GiB 
-  Current LE             32768 
-  Segments               1 
-  Allocation             inherit 
-  Read ahead sectors     auto 
-  - currently set to     8192 
-  Block device           253:5 
-</file> 
- 
-<file bash> 
-$ sudo mkfs.xfs /dev/vgPGSQL/lvZABBIX 
-meta-data=/dev/vgPGSQL/lvZABBIX  isize=512    agcount=4, agsize=8388608 blks 
-                               sectsz=512   attr=2, projid32bit=1 
-                               crc=1        finobt=1, sparse=1, rmapbt=0 
-                               reflink=1    bigtime=0 inobtcount=0 
-data                           bsize=4096   blocks=33554432, imaxpct=25 
-                               sunit=0      swidth=0 blks 
-naming   =version 2              bsize=4096   ascii-ci=0, ftype=1 
-log      =internal log           bsize=4096   blocks=16384, version=2 
-                               sectsz=512   sunit=0 blks, lazy-count=1 
-realtime =none                   extsz=4096   blocks=0, rtextents=0 
-</file> 
- 
-<file bash> 
-$ sudo mkdir -p /pgsql/zabbix 
-$ sudo mount /dev/vgPGSQL/lvZABBIX /pgsql/zabbix 
-</file> 
- 
-<file bash> 
-$ sudo blkid | egrep vg 
-/dev/mapper/vgPGSQL-lvZABBIX: UUID="f7fd8b97-7914-40c8-862a-79123a67a512" BLOCK_SIZE="512" TYPE="xfs" 
-</file> 
- 
-<file bash> 
-$ echo -e "UUID=f7fd8b97-7914-40c8-862a-79123a67a512\t/pgsql/zabbix\txfs\tdefaults\t0 0" | sudo tee -a /etc/fstab 
-UUID=f7fd8b97-7914-40c8-862a-79123a67a512       /pgsql/zabbix   xfs     defaults        0 0 
-</file> 
- 
-<file bash> 
-$ sudo mount -a 
-$ mount | grep pgsql 
-/dev/mapper/vgPGSQL-lvZABBIX on /pgsql/zabbix type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota) 
-</file> 
- 
-<file bash> 
-$ df -h | grep pgsql 
-/dev/mapper/vgPGSQL-lvZABBIX  128G  946M  128G   1% /pgsql/zabbix 
-</file> 
- 
-===== Criando o banco e o acesso do zabbix ===== 
-<file bash> 
-$ sudo su - postgres 
-Último login:qui jun 16 10:47:12 -03 2022em pts/0 
-[postgres@pgsql ~]$ psql 
-psql (14.3) 
-Type "help" for help. 
- 
-postgres=# create tablespace datasxb location '/pgsql/zabbix'; 
-ERROR:  could not set permissions on directory "/pgsql/zabbix": Operation not permitted 
-</file> 
- 
-<file bash> 
-$ sudo chown postgres:postgres /pgsql/zabbix/ -R 
-$ sudo semanage fcontext -a -t postgresql_db_t "/pgsql/zabbix(/.*)?" 
-$ sudo restorecon -R -v /pgsql/zabbix/ 
-</file> 
- 
-Ou 
- 
-<file bash> 
-$ sudo chcon -Rt postgresql_db_t /pgsql/zabbix 
-</file> 
- 
-<file> 
-$ ls -laZ /pgsql/zabbix/ 
-total 0 
-drwxr-xr-x. 2 postgres postgres system_u:object_r:postgresql_db_t:s0  6 jun 16 10:32 . 
-drwxr-xr-x. 3 root     root     unconfined_u:object_r:default_t:s0   20 jun 16 10:33 .. 
-</file> 
- 
-<file bash> 
-postgres=# create tablespace dataszb location '/pgsql/zabbix'; 
-CREATE TABLESPACE 
-postgres=# create role zabbix login ; 
-CREATE ROLE 
-postgres=# \password zabbix 
-Enter new password for user "zabbix": 
-Enter it again: 
- 
-postgres=# create database zabbix owner zabbix tablespace dataszb; 
-CREATE DATABASE 
-postgres=# \c zabbix 
-You are now connected to database "zabbix" as user "postgres". 
-                                ^ 
-zabbix=# create extension if not exists timescaledb cascade; 
-WARNING: 
-WELCOME TO 
- _____ _                                   ____________ 
-|_   _(_)                             | |    |  _  \ ___ \ 
-  | |  _ _ __ ___   ___  ___  ___ __ _| | ___| | | | |_/ / 
-  | | | |  _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \ 
-  | | | | | | | | |  __/\__ \ (_| (_| | |  __/ |/ /| |_/ / 
-  |_| |_|_| |_| |_|\___||___/\___\__,_|_|\___|___/ \____/ 
-               Running version 2.7.0 
-For more information on TimescaleDB, please visit the following links: 
- 
- 1. Getting started: https://docs.timescale.com/timescaledb/latest/getting-started 
- 2. API reference documentation: https://docs.timescale.com/api/latest 
- 3. How TimescaleDB is designed: https://docs.timescale.com/timescaledb/latest/overview/core-concepts 
- 
-Note: TimescaleDB collects anonymous reports to better understand and assist our users. 
-For more information and how to disable, please see our docs https://docs.timescale.com/timescaledb/latest/how-to-guides/configuration/telemetry. 
- 
-CREATE EXTENSION 
-</file> 
- 
-<file bash> 
-zabbix=# \dx 
-                                      List of installed extensions 
-    Name     | Version |   Schema                              Description 
--------------+---------+------------+------------------------------------------------------------------- 
- plpgsql     | 1.0     | pg_catalog | PL/pgSQL procedural language 
- timescaledb | 2.7.0   | public     | Enables scalable inserts and complex queries for time-series data 
-(2 rows) 
-</file> 
- 
-<file bash> 
-$ sudo rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm 
-[sudo] senha para suporte: 
-Obtendo https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-1.el8.noarch.rpm 
-aviso: /var/tmp/rpm-tmp.CnkNDh: Cabeçalho V4 RSA/SHA512 Signature, ID da chave a14fe591: NOKEY 
-Verifying...                          ################################# [100%] 
-Preparando...                         ################################# [100%] 
-Updating / installing... 
-   1:zabbix-release-6.0-1.el8         ################################# [100%] 
-</file> 
- 
-<file bash> 
-$ sudo dnf install zabbix-agent2 zabbix-sql-scripts 
-</file> 
- 
-<file bash> 
-$ rpm -qil zabbix-sql-scripts-6.0.5-1.el8.noarch 
-Name        : zabbix-sql-scripts 
-Version     : 6.0.5 
-Release     : 1.el8 
-Architecture: noarch 
-Install Date: qui 16 jun 2022 11:12:58 -03 
-Group       : Applications/Internet 
-Size        : 8717520 
-License     : GPLv2+ 
-Signature   : RSA/SHA512, seg 30 mai 2022 08:39:56 -03, Key ID 082ab56ba14fe591 
-Source RPM  : zabbix-6.0.5-1.el8.src.rpm 
-Build Date  : seg 30 mai 2022 07:45:34 -03 
-Build Host  : e598b51f5fb3 
-Relocations : (not relocatable) 
-URL         : http://www.zabbix.com/ 
-Summary     : Zabbix database sql scripts 
-Description : 
-SQL files needed to setup Zabbix server or proxy databases 
-/usr/share/doc/zabbix-sql-scripts 
-/usr/share/doc/zabbix-sql-scripts/AUTHORS 
-/usr/share/doc/zabbix-sql-scripts/COPYING 
-/usr/share/doc/zabbix-sql-scripts/ChangeLog 
-/usr/share/doc/zabbix-sql-scripts/NEWS 
-/usr/share/doc/zabbix-sql-scripts/README 
-/usr/share/doc/zabbix-sql-scripts/mysql/double.sql 
-/usr/share/doc/zabbix-sql-scripts/mysql/history_pk_prepare.sql 
-/usr/share/doc/zabbix-sql-scripts/mysql/proxy.sql 
-/usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz 
-/usr/share/doc/zabbix-sql-scripts/postgresql/double.sql 
-/usr/share/doc/zabbix-sql-scripts/postgresql/history_pk_prepare.sql 
-/usr/share/doc/zabbix-sql-scripts/postgresql/proxy.sql 
-/usr/share/doc/zabbix-sql-scripts/postgresql/server.sql.gz 
-/usr/share/doc/zabbix-sql-scripts/postgresql/timescaledb.sql 
-/usr/share/doc/zabbix-sql-scripts/sqlite3/proxy.sql 
-</file> 
- 
-<file bash> 
-$ sudo su - postgres 
-Último login:qui jun 16 10:59:31 -03 2022em pts/0 
-</file> 
- 
-<file bash> 
-$ sudo vim /var/lib/pgsql/14/data/pg_hba.conf 
-[...] 
-# Acesso Zabbix 
-host    zabbix          zabbix          ::1/128                 scram-sha-256 
-host    zabbix          zabbix          2804:694:4c00:4007::/64 scram-sha-256 
-</file> 
- 
-<file bash> 
-$ sudo vim /var/lib/pgsql/14/data/postgresql.conf 
-[...] 
-#listen_addresses = 'localhost'         # what IP address(es) to listen on; 
-listen_addresses = '*'                  # what IP address(es) to listen on; 
-[...] 
-</file> 
- 
-<file bash> 
-$ sudo systemctl restart postgresql-14 
-</file> 
- 
-<file bash> 
-$ zcat /usr/share/doc/zabbix-sql-scripts/postgresql/server.sql.gz | psql -h ::1 -U zabbix zabbix 
-$ psql -h ::1 -U zabbix zabbix < /usr/share/doc/zabbix-sql-scripts/postgresql/timescaledb.sql 
-</file> 
- 
-<file bash> 
-$ sudo firewall-cmd --permanent --add-service postgresql 
-$ sudo firewall-cmd --reload 
-</file> 
- 
-===== Testando a conexão ===== 
- 
-==== Executar no Kubernetes control plane ==== 
- 
-<file bash> 
-$ sudo apt install postgresql-client 
-</file> 
- 
-<file bash> 
-$ psql -h pgsql.juntotelecom.com.br -U zabbix zabbix 
-Password for user zabbix: 
-psql (13.5 (Debian 13.5-0+deb11u1), server 14.3) 
-WARNING: psql major version 13, server major version 14. 
-         Some psql features might not work. 
-Type "help" for help. 
- 
-zabbix=> 
-</file> 
-===== Zabbix ===== 
-<file bash> 
-kubectl create namespace monitoring-system -o yaml \ 
---dry-run=client > namespace-monitoring.yaml 
-</file> 
- 
-<file bash> 
-$ kubectl apply -f namespace-monitoring.yaml 
-namespace/monitoring-system created 
-</file> 
- 
-<file bash> 
-$ cat pgsql-secret 
-db-zbx-pass=Z9Ty7kjnE_lY?z 
-</file> 
- 
-<file bash> 
-$ kubectl create secret generic pgsql-secret -n monitoring-system \ 
---from-env-file=pgsql-secret -o yaml \ 
---dry-run=client > pgsql-secret.yaml 
-</file> 
- 
-<file bash> 
-$ kubectl apply -f pgsql-secret.yaml 
-secret/pgsql-secret created 
-</file> 
- 
-==== Zabbix Server ==== 
-<file yaml zabbix-server-deployment.yaml> 
-$ cat zabbix-server.yaml 
-apiVersion: apps/v1 
-kind: StatefulSet 
-metadata: 
-  labels: 
-    app: zabbix-server 
-  name: zabbix-server 
-  namespace: monitoring-system 
-spec: 
-  selector: 
-    matchLabels: 
-      app: zabbix-server 
-  serviceName: zabbix-server 
-  template: 
-    metadata: 
-      labels: 
-        app: zabbix-server 
-    spec: 
-      containers: 
-      - env: 
-        - name: DB_SERVER_HOST 
-          value: pgsql.juntotelecom.com.br 
-        - name: POSTGRES_USER 
-          value: zabbix 
-        - name: POSTGRES_PASSWORD 
-          valueFrom: 
-            secretKeyRef: 
-              key: db-zbx-pass 
-              name: pgsql-secret 
-        - name: POSTGRES_DB 
-          value: zabbix 
-        - name: ZBX_CACHESIZE 
-        - name: ZBX_STARTPOLLERS 
-        - name: ZBX_STARTTRAPPERS 
-        - name: ZBX_STARTPINGERS 
-        image: zabbix/zabbix-server-pgsql:ol-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        name: zabbix-server 
-        ports: 
-        - containerPort: 10051 
-          name: zabbix-trapper 
-          protocol: TCP 
-        - containerPort: 10052 
-          name: zabbix-jmx 
-          protocol: TCP 
-        resources: {} 
-        securityContext: 
-          capabilities: {} 
-          privileged: false 
-      - env: 
-        - name: ZBX_HOSTNAME 
-          value: zabbix-agent 
-        - name: ZBX_SERVER_HOST 
-          value: 127.0.0.1 
-        - name: ZBX_SERVER_PORT 
-          value: "10051" 
-        - name: ZBX_PASSIVE_ALLOW 
-          value: "true" 
-        - name: ZBX_PASSIVESERVERS 
-          value: 127.0.0.1 
-        - name: ZBX_ACTIVE_ALLOW 
-          value: "true" 
-        - name: ZBX_ACTIVESERVERS 
-        - name: ZBX_DEBUGLEVEL 
-        - name: ZBX_TIMEOUT 
-        - name: ZBX_LOADMODULE 
-        image: zabbix/zabbix-agent2:ol-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        name: zabbix-agent 
-        ports: 
-        - containerPort: 10050 
-          name: zabbix-agent 
-          protocol: TCP 
-        resources: 
-          limits: 
-            cpu: 200m 
-            memory: 128Mi 
-          requests: 
-            cpu: 100m 
-            memory: 64Mi 
-        securityContext: 
-          capabilities: {} 
-          privileged: true 
-      restartPolicy: Always 
-      securityContext: {} 
-</file> 
- 
-<file yaml zabbix-server-service.yaml> 
-$ cat svc-zabbix-server.yaml 
-apiVersion: v1 
-kind: Service 
-metadata: 
-  labels: 
-    app: zabbix-server 
-  name: zabbix-server 
-  namespace: monitoring-system 
-spec: 
-  ipFamilies: 
-  - IPv4 
-  - IPv6 
-  ipFamilyPolicy: PreferDualStack 
-  ports: 
-  - name: zabbix-server 
-    port: 10051 
-    protocol: TCP 
-    targetPort: 10051 
-  - name: zabbix-jmx 
-    port: 10052 
-    protocol: TCP 
-    targetPort: 10052 
-  selector: 
-    app: zabbix-server 
-  type: ClusterIP 
-</file> 
- 
-==== Zabbix proxy ==== 
-<file yaml zabbix-proxy-sqlite3.yaml> 
-apiVersion: apps/v1 
-kind: Deployment 
-metadata: 
-  labels: 
-    app: zabbix-proxy 
-  name: zabbix-proxy 
-  namespace: monitoring-system 
-spec: 
-  selector: 
-    matchLabels: 
-      app: zabbix-proxy 
-      name: zabbix-proxy 
-  template: 
-    metadata: 
-      labels: 
-        app: zabbix-proxy 
-        name: zabbix-proxy 
-    spec: 
-      containers: 
-      - env: 
-        - name: ZBX_PROXYMODE 
-          value: "0" 
-        - name: ZBX_HOSTNAME 
-          value: zabbix-proxy 
-        - name: ZBX_SERVER_HOST 
-          value: zabbix-server 
-        - name: ZBX_SERVER_PORT 
-          value: "10051" 
-        - name: ZBX_ENABLE_SNMP_TRAPS 
-          value: "true" 
-        image: zabbix/zabbix-proxy-sqlite3:ol-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        name: zabbix-proxy 
-        ports: 
-        - containerPort: 10051 
-          name: zabbix-trapper 
-          protocol: TCP 
-        resources: {} 
-        securityContext: 
-          capabilities: {} 
-          privileged: false 
-        volumeMounts: 
-        - mountPath: /var/lib/zabbix/snmptraps 
-          name: zabbix-snmptraps 
-          readOnly: true 
-      - image: zabbix/zabbix-snmptraps:ol-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        name: zabbix-snmptraps 
-        ports: 
-        - containerPort: 1162 
-          name: snmp-trap 
-          protocol: UDP 
-        resources: 
-          limits: 
-            cpu: 250m 
-            memory: 256M 
-          requests: 
-            cpu: 150m 
-            memory: 128M 
-        securityContext: 
-          capabilities: {} 
-          privileged: false 
-        volumeMounts: 
-        - mountPath: /var/lib/zabbix/snmptraps/ 
-          name: zabbix-snmptraps 
-      - env: 
-        - name: ZBX_HOSTNAME 
-          value: zabbix-agent 
-        - name: ZBX_SERVER_HOST 
-          value: zabbix-proxy 
-        - name: ZBX_SERVER_PORT 
-          value: "10051" 
-        image: zabbix/zabbix-agent2:ol-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        name: zabbix-agent 
-        ports: 
-        - containerPort: 10050 
-          name: zabbix-agent 
-          protocol: TCP 
-        resources: 
-          limits: 
-            cpu: 200m 
-            memory: 128Mi 
-          requests: 
-            cpu: 100m 
-            memory: 64Mi 
-        securityContext: 
-          capabilities: {} 
-          privileged: true 
-      restartPolicy: Always 
-      securityContext: {} 
-      volumes: 
-      - emptyDir: {} 
-        name: zabbix-snmptraps 
-</file> 
- 
-<file yaml svc-zabbix-proxy.yaml> 
-apiVersion: v1 
-kind: Service 
-metadata: 
-  labels: 
-    app: zabbix-proxy 
-  name: zabbix-proxy 
-  namespace: monitoring-system 
-spec: 
-  ipFamilies: 
-  - IPv4 
-  - IPv6 
-  ipFamilyPolicy: PreferDualStack 
-  ports: 
-  - name: zabbix-trapper 
-    port: 10051 
-    protocol: TCP 
-    targetPort: 10051 
-  - name: snmp-trap 
-    port: 162 
-    protocol: UDP 
-    targetPort: 1162 
-  selector: 
-    name: zabbix-proxy 
-  type: ClusterIP 
-</file> 
-==== Zabbix Web ==== 
-<file yaml zabbix-web-deployment.yaml> 
-$ cat zabbix-we.yaml 
-apiVersion: apps/v1 
-kind: Deployment 
-metadata: 
-  labels: 
-    app: zabbix-web 
-  name: zabbix-web 
-  namespace: monitoring-system 
-spec: 
-  selector: 
-    matchLabels: 
-      app: zabbix-web 
-  template: 
-    metadata: 
-      labels: 
-        app: zabbix-web 
-    spec: 
-      containers: 
-      - env: 
-        - name: ZBX_SERVER_HOST 
-          value: zabbix-server 
-        - name: ZBX_SERVER_PORT 
-          value: "10051" 
-        - name: DB_SERVER_HOST 
-          value: pgsql.juntotelecom.com.br 
-        - name: DB_SERVER_PORT 
-          value: "5432" 
-        - name: POSTGRES_USER 
-          value: zabbix 
-        - name: POSTGRES_PASSWORD 
-          valueFrom: 
-            secretKeyRef: 
-              key: db-zbx-pass 
-              name: pgsql-secret 
-        - name: POSTGRES_DB 
-          value: zabbix 
-        image: zabbix/zabbix-web-nginx-pgsql:ol-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        name: zabbix-web 
-        ports: 
-        - containerPort: 8080 
-          name: zabbix-web 
-          protocol: TCP 
-        resources: {} 
-      restartPolicy: Always 
-      securityContext: {} 
-</file> 
- 
-<file yaml zabbix-web-service.yaml> 
-$ cat svc-zabbix-web.yaml 
-apiVersion: v1 
-kind: Service 
-metadata: 
-  labels: 
-    app: zabbix-web 
-  name: zabbix-web 
-  namespace: monitoring-system 
-spec: 
-  ipFamilies: 
-  - IPv4 
-  - IPv6 
-  ipFamilyPolicy: PreferDualStack 
-  ports: 
-  - name: zabbix-web 
-    nodePort: 30162 
-    port: 80 
-    protocol: TCP 
-    targetPort: 8080 
-  selector: 
-    app: zabbix-web 
-  type: NodePort 
-</file> 
- 
-===== Zabbix deploy all ===== 
-<file yaml> 
-apiVersion: apps/v1 
-kind: Deployment 
-metadata: 
-  labels: 
-    app: zabbix 
-  name: zabbix 
-spec: 
-  replicas: 1 
-  selector: 
-    matchLabels: 
-      app: zabbix 
-  template: 
-    metadata: 
-      labels: 
-        app: zabbix 
-    spec: 
-      containers: 
-      - name: postgres 
-        image: postgres:14 
-        imagePullPolicy: IfNotPresent 
-        ports: 
-        - containerPort: 5432 
-          name: postgres 
-          protocol: TCP 
-        env: 
-        - name: POSTGRES_USER 
-          value: zabbix 
-        - name: POSTGRES_PASSWORD 
-          value: zabbix 
-        - name: ENABLE_TIMESCALEDB 
-          value: "true" 
-        volumeMounts: 
-        - name: data 
-          mountPath: /var/lib/postgresql/data 
- 
-      - name: zabbix-server 
-        image: zabbix/zabbix-server-pgsql:alpine-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        ports: 
-        - containerPort: 10051 
-          name: zabbix-trapper 
-          protocol: TCP 
-        env: 
-        - name: DB_SERVER_HOST 
-          value: localhost 
-        - name: POSTGRES_USER 
-          value: zabbix 
-        - name: POSTGRES_PASSWORD 
-          value: zabbix 
-        - name: POSTGRES_DB 
-          value: zabbix 
- 
-      - name: zabbix-web 
-        image: zabbix/zabbix-web-nginx-pgsql:alpine-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        ports: 
-        - containerPort: 8080 
-          name: zabbix-web 
-          protocol: TCP 
-        env: 
-        - name: DB_SERVER_HOST 
-          value: localhost 
-        - name: POSTGRES_USER 
-          value: zabbix 
-        - name: POSTGRES_PASSWORD 
-          value: zabbix 
-        - name: POSTGRES_DB 
-          value: zabbix 
-        - name: ZBX_SERVER_HOST 
-          value: localhost 
-        - name: ZBX_SERVER_NAME 
-          value: Zabbix Kubernetes 
-        - name: PHP_TZ 
-          value: America/Sao_Paulo 
- 
-      - name: zabbix-proxy 
-        image: zabbix/zabbix-proxy-sqlite3:alpine-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        ports: 
-        - containerPort: 10051 
-          name: zabbix-trapper 
-          protocol: TCP 
-        env: 
-        - name: ZBX_HOSTNAME 
-          value: zabbix-proxy 
-        - name: ZBX_SERVER_HOST 
-          value: localhost 
-        - name: ZBX_ENABLE_SNMP_TRAPS 
-          value: "true" 
-        - name: ZBX_VMWARETIMEOUT 
-          value: "120" 
-        - name: ZBX_STARTVMWARECOLLECTORS 
-          value: "3" 
-        - name: ZBX_VMWARECACHESIZE 
-          value: 128M 
-        - name: ZBX_VMWAREFREQUENCY 
-          value: "60" 
-        - name: ZBX_VMWAREPERFFREQUENCY 
-          value: "60" 
-        volumeMounts: 
-        - name: snmptraps 
-          mountPath: /var/lib/zabbix/snmptraps 
-          readOnly: true 
-        - name: externalscripts 
-          mountPath: /usr/lib/zabbix/externalscripts 
-          readOnly: true 
-        - name: mibs 
-          mountPath: /var/lib/zabbix/mibs 
-          readOnly: true 
- 
-      - name: zabbix-agent 
-        image: zabbix/zabbix-agent:alpine-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        ports: 
-        - containerPort: 10050 
-          name: zabbix-agent 
-          protocol: TCP 
-        env: 
-        - name: ZBX_SERVER_HOST 
-          value: localhost 
-        securityContext: 
-          privileged: true 
- 
-      - name: zabbix-snmptraps 
-        image: zabbix/zabbix-snmptraps:alpine-6.0-latest 
-        imagePullPolicy: IfNotPresent 
-        ports: 
-        - containerPort: 1162 
-          name: snmp-trap 
-          protocol: UDP 
-        volumeMounts: 
-        - name: snmptraps 
-          mountPath: /var/lib/zabbix/snmptraps 
-        - name: mibs 
-          mountPath: /var/lib/zabbix/mibs 
- 
-      volumes: 
-      - name: data 
-        persistentVolumeClaim: 
-          claimName: data 
-      - name: mibs 
-        persistentVolumeClaim: 
-          claimName: mibs 
-      - name: externalscripts 
-        persistentVolumeClaim: 
-          claimName: externalscripts 
-      - name: snmptraps 
-        persistentVolumeClaim: 
-          claimName: snmptraps 
-</file> 
- 
-==== Export ==== 
-<file yaml> 
-apiVersion: v1 
-items: 
-- apiVersion: apps/v1 
-  kind: Deployment 
-  metadata: 
-    labels: 
-      app: zabbix 
-    name: zabbix 
-    namespace: default 
-  spec: 
-    selector: 
-      matchLabels: 
-        app: zabbix 
-    template: 
-      metadata: 
-        labels: 
-          app: zabbix 
-      spec: 
-        containers: 
-        - env: 
-          - name: POSTGRES_USER 
-            value: zabbix 
-          - name: POSTGRES_PASSWORD 
-            value: zabbix 
-          - name: ENABLE_TIMESCALEDB 
-            value: "true" 
-          image: postgres:14 
-          imagePullPolicy: IfNotPresent 
-          name: postgres 
-          ports: 
-          - containerPort: 5432 
-            name: postgres 
-            protocol: TCP 
-          resources: {} 
-          volumeMounts: 
-          - mountPath: /var/lib/postgresql/data 
-            name: data 
-        - env: 
-          - name: DB_SERVER_HOST 
-            value: localhost 
-          - name: POSTGRES_USER 
-            value: zabbix 
-          - name: POSTGRES_PASSWORD 
-            value: zabbix 
-          - name: POSTGRES_DB 
-            value: zabbix 
-          image: zabbix/zabbix-server-pgsql:alpine-6.0-latest 
-          imagePullPolicy: IfNotPresent 
-          name: zabbix-server 
-          ports: 
-          - containerPort: 10051 
-            name: zabbix-trapper 
-            protocol: TCP 
-          resources: {} 
-        - env: 
-          - name: DB_SERVER_HOST 
-            value: localhost 
-          - name: POSTGRES_USER 
-            value: zabbix 
-          - name: POSTGRES_PASSWORD 
-            value: zabbix 
-          - name: POSTGRES_DB 
-            value: zabbix 
-          - name: ZBX_SERVER_HOST 
-            value: localhost 
-          - name: ZBX_SERVER_NAME 
-            value: Zabbix Kubernetes 
-          - name: PHP_TZ 
-            value: America/Sao_Paulo 
-          image: zabbix/zabbix-web-nginx-pgsql:alpine-6.0-latest 
-          imagePullPolicy: IfNotPresent 
-          name: zabbix-web 
-          ports: 
-          - containerPort: 8080 
-            name: zabbix-web 
-            protocol: TCP 
-          resources: {} 
-        - env: 
-          - name: ZBX_HOSTNAME 
-            value: zabbix-proxy 
-          - name: ZBX_SERVER_HOST 
-            value: localhost 
-          - name: ZBX_ENABLE_SNMP_TRAPS 
-            value: "true" 
-          - name: ZBX_VMWARETIMEOUT 
-            value: "120" 
-          - name: ZBX_STARTVMWARECOLLECTORS 
-            value: "3" 
-          - name: ZBX_VMWARECACHESIZE 
-            value: 128M 
-          - name: ZBX_VMWAREFREQUENCY 
-            value: "60" 
-          - name: ZBX_VMWAREPERFFREQUENCY 
-            value: "60" 
-          image: zabbix/zabbix-proxy-sqlite3:alpine-6.0-latest 
-          imagePullPolicy: IfNotPresent 
-          name: zabbix-proxy 
-          ports: 
-          - containerPort: 10051 
-            name: zabbix-trapper 
-            protocol: TCP 
-          resources: {} 
-          volumeMounts: 
-          - mountPath: /var/lib/zabbix/snmptraps 
-            name: snmptraps 
-            readOnly: true 
-          - mountPath: /usr/lib/zabbix/externalscripts 
-            name: externalscripts 
-            readOnly: true 
-          - mountPath: /var/lib/zabbix/mibs 
-            name: mibs 
-            readOnly: true 
-        - env: 
-          - name: ZBX_SERVER_HOST 
-            value: localhost 
-          image: zabbix/zabbix-agent:alpine-6.0-latest 
-          imagePullPolicy: IfNotPresent 
-          name: zabbix-agent 
-          ports: 
-          - containerPort: 10050 
-            name: zabbix-agent 
-            protocol: TCP 
-          resources: {} 
-          securityContext: 
-            privileged: true 
-        - image: zabbix/zabbix-snmptraps:alpine-6.0-latest 
-          imagePullPolicy: IfNotPresent 
-          name: zabbix-snmptraps 
-          ports: 
-          - containerPort: 1162 
-            name: snmp-trap 
-            protocol: UDP 
-          resources: {} 
-          volumeMounts: 
-          - mountPath: /var/lib/zabbix/snmptraps 
-            name: snmptraps 
-          - mountPath: /var/lib/zabbix/mibs 
-            name: mibs 
-        dnsPolicy: ClusterFirst 
-        restartPolicy: Always 
-        volumes: 
-        - name: data 
-          persistentVolumeClaim: 
-            claimName: data 
-        - name: mibs 
-          persistentVolumeClaim: 
-            claimName: mibs 
-        - name: externalscripts 
-          persistentVolumeClaim: 
-            claimName: externalscripts 
-        - name: snmptraps 
-          persistentVolumeClaim: 
-            claimName: snmptraps 
-</file> 
- 
-==== PVC ==== 
-<file yaml> 
-apiVersion: v1 
-kind: PersistentVolumeClaim 
-metadata: 
-  name: data 
-  namespace: default 
-spec: 
-  accessModes: 
-  - ReadWriteMany 
-  resources: 
-    requests: 
-      storage: 8Gi 
-  storageClassName: nfs-client 
- 
---- 
-apiVersion: v1 
-kind: PersistentVolumeClaim 
-metadata: 
-  name: mibs 
-  namespace: default 
-spec: 
-  accessModes: 
-  - ReadWriteMany 
-  resources: 
-    requests: 
-      storage: 1Gi 
-  storageClassName: nfs-client 
- 
---- 
-apiVersion: v1 
-kind: PersistentVolumeClaim 
-metadata: 
-  name: externalscripts 
-  namespace: default 
-spec: 
-  accessModes: 
-  - ReadWriteMany 
-  resources: 
-    requests: 
-      storage: 1Gi 
-  storageClassName: nfs-client 
- 
---- 
-apiVersion: v1 
-kind: PersistentVolumeClaim 
-metadata: 
-  name: snmptraps 
-  namespace: default 
-spec: 
-  accessModes: 
-  - ReadWriteMany 
-  resources: 
-    requests: 
-      storage: 1Gi 
-  storageClassName: nfs-client 
-</file> 
  
zabbix_deploy.1753560545.txt.gz · Last modified: by wikiadm