zabbix_deploy
Differences
This shows you the differences between two versions of the page.
| zabbix_deploy [2025/07/26 17:09] – - Imported by DokuWiki Advanced Plugin wikiadm | zabbix_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/ | ||
| - | Tamanho E/S (mínimo/ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo pvcreate /dev/sdb | ||
| - | Physical volume "/ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo vgcreate vgPGSQL /dev/sdb | ||
| - | Volume group " | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo lvcreate -L 128G -n lvZABBIX vgPGSQL | ||
| - | Logical volume " | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo pvdisplay /dev/sdb | ||
| - | --- Physical volume --- | ||
| - | PV Name / | ||
| - | VG Name | ||
| - | PV Size | ||
| - | Allocatable | ||
| - | PE Size 4,00 MiB | ||
| - | Total PE 65535 | ||
| - | Free PE 32767 | ||
| - | Allocated PE 32768 | ||
| - | PV UUID | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo vgdisplay vgPGSQL | ||
| - | --- Volume group --- | ||
| - | VG Name | ||
| - | System ID | ||
| - | Format | ||
| - | Metadata Areas 1 | ||
| - | Metadata Sequence No 2 | ||
| - | VG Access | ||
| - | VG Status | ||
| - | MAX LV 0 | ||
| - | Cur LV 1 | ||
| - | Open LV 0 | ||
| - | Max PV 0 | ||
| - | Cur PV 1 | ||
| - | Act PV 1 | ||
| - | VG Size < | ||
| - | PE Size 4,00 MiB | ||
| - | Total PE 65535 | ||
| - | Alloc PE / Size 32768 / 128,00 GiB | ||
| - | Free PE / Size 32767 / <128,00 GiB | ||
| - | VG UUID | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo lvdisplay / | ||
| - | --- Logical volume --- | ||
| - | LV Path / | ||
| - | LV Name lvZABBIX | ||
| - | VG Name vgPGSQL | ||
| - | LV UUID eTY2Ei-WtK3-Z97x-7Hbj-vKPc-ly1U-jWhRZi | ||
| - | LV Write Access | ||
| - | LV Creation host, time pgsql, 2022-06-16 10:24:32 -0300 | ||
| - | LV Status | ||
| - | # open 0 | ||
| - | LV Size 128,00 GiB | ||
| - | Current LE 32768 | ||
| - | Segments | ||
| - | Allocation | ||
| - | Read ahead sectors | ||
| - | - currently set to 8192 | ||
| - | Block device | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo mkfs.xfs / | ||
| - | meta-data=/ | ||
| - | | ||
| - | | ||
| - | | ||
| - | data | ||
| - | | ||
| - | naming | ||
| - | log =internal log | ||
| - | | ||
| - | realtime =none | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo mkdir -p / | ||
| - | $ sudo mount / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo blkid | egrep vg | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ echo -e " | ||
| - | UUID=f7fd8b97-7914-40c8-862a-79123a67a512 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo mount -a | ||
| - | $ mount | grep pgsql | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ df -h | grep pgsql | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | ===== 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 " | ||
| - | |||
| - | postgres=# create tablespace datasxb location '/ | ||
| - | ERROR: | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo chown postgres: | ||
| - | $ sudo semanage fcontext -a -t postgresql_db_t "/ | ||
| - | $ sudo restorecon -R -v / | ||
| - | </ | ||
| - | |||
| - | Ou | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo chcon -Rt postgresql_db_t / | ||
| - | </ | ||
| - | |||
| - | < | ||
| - | $ ls -laZ / | ||
| - | total 0 | ||
| - | drwxr-xr-x. 2 postgres postgres system_u: | ||
| - | drwxr-xr-x. 3 root | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | postgres=# create tablespace dataszb location '/ | ||
| - | CREATE TABLESPACE | ||
| - | postgres=# create role zabbix login ; | ||
| - | CREATE ROLE | ||
| - | postgres=# \password zabbix | ||
| - | Enter new password for user " | ||
| - | Enter it again: | ||
| - | |||
| - | postgres=# create database zabbix owner zabbix tablespace dataszb; | ||
| - | CREATE DATABASE | ||
| - | postgres=# \c zabbix | ||
| - | You are now connected to database " | ||
| - | ^ | ||
| - | zabbix=# create extension if not exists timescaledb cascade; | ||
| - | WARNING: | ||
| - | WELCOME TO | ||
| - | _____ _ | ||
| - | |_ | ||
| - | | | _ _ __ ___ | ||
| - | | | | | _ ` _ \ / _ \/ __|/ __/ _` | |/ _ \ | | | ___ \ | ||
| - | | | | | | | | | | __/\__ \ (_| (_| | | __/ |/ /| |_/ / | ||
| - | |_| |_|_| |_| |_|\___||___/ | ||
| - | | ||
| - | For more information on TimescaleDB, | ||
| - | |||
| - | 1. Getting started: https:// | ||
| - | 2. API reference documentation: | ||
| - | 3. How TimescaleDB is designed: https:// | ||
| - | |||
| - | Note: TimescaleDB collects anonymous reports to better understand and assist our users. | ||
| - | For more information and how to disable, please see our docs https:// | ||
| - | |||
| - | CREATE EXTENSION | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | zabbix=# \dx | ||
| - | List of installed extensions | ||
| - | Name | Version | | ||
| - | -------------+---------+------------+------------------------------------------------------------------- | ||
| - | | ||
| - | | ||
| - | (2 rows) | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo rpm -Uvh https:// | ||
| - | [sudo] senha para suporte: | ||
| - | Obtendo https:// | ||
| - | aviso: / | ||
| - | Verifying... | ||
| - | Preparando... | ||
| - | Updating / installing... | ||
| - | | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo dnf install zabbix-agent2 zabbix-sql-scripts | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ rpm -qil zabbix-sql-scripts-6.0.5-1.el8.noarch | ||
| - | Name : zabbix-sql-scripts | ||
| - | Version | ||
| - | Release | ||
| - | Architecture: | ||
| - | Install Date: qui 16 jun 2022 11:12:58 -03 | ||
| - | Group : Applications/ | ||
| - | Size : 8717520 | ||
| - | License | ||
| - | Signature | ||
| - | 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:// | ||
| - | Summary | ||
| - | Description : | ||
| - | SQL files needed to setup Zabbix server or proxy databases | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo su - postgres | ||
| - | Último login:qui jun 16 10:59:31 -03 2022em pts/0 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo vim / | ||
| - | [...] | ||
| - | # Acesso Zabbix | ||
| - | host zabbix | ||
| - | host zabbix | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo vim / | ||
| - | [...] | ||
| - | # | ||
| - | listen_addresses = ' | ||
| - | [...] | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo systemctl restart postgresql-14 | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ zcat / | ||
| - | $ psql -h ::1 -U zabbix zabbix < / | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo firewall-cmd --permanent --add-service postgresql | ||
| - | $ sudo firewall-cmd --reload | ||
| - | </ | ||
| - | |||
| - | ===== Testando a conexão ===== | ||
| - | |||
| - | ==== Executar no Kubernetes control plane ==== | ||
| - | |||
| - | <file bash> | ||
| - | $ sudo apt install postgresql-client | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ psql -h pgsql.juntotelecom.com.br -U zabbix zabbix | ||
| - | Password for user zabbix: | ||
| - | psql (13.5 (Debian 13.5-0+deb11u1), | ||
| - | WARNING: psql major version 13, server major version 14. | ||
| - | Some psql features might not work. | ||
| - | Type " | ||
| - | |||
| - | zabbix=> | ||
| - | </ | ||
| - | ===== Zabbix ===== | ||
| - | <file bash> | ||
| - | kubectl create namespace monitoring-system -o yaml \ | ||
| - | --dry-run=client > namespace-monitoring.yaml | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ kubectl apply -f namespace-monitoring.yaml | ||
| - | namespace/ | ||
| - | </ | ||
| - | |||
| - | <file bash> | ||
| - | $ cat pgsql-secret | ||
| - | db-zbx-pass=Z9Ty7kjnE_lY? | ||
| - | </ | ||
| - | |||
| - | <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 bash> | ||
| - | $ kubectl apply -f pgsql-secret.yaml | ||
| - | secret/ | ||
| - | </ | ||
| - | |||
| - | ==== 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: | ||
| - | 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/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-server | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: zabbix-trapper | ||
| - | protocol: TCP | ||
| - | - containerPort: | ||
| - | 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: " | ||
| - | - name: ZBX_PASSIVE_ALLOW | ||
| - | value: " | ||
| - | - name: ZBX_PASSIVESERVERS | ||
| - | value: 127.0.0.1 | ||
| - | - name: ZBX_ACTIVE_ALLOW | ||
| - | value: " | ||
| - | - name: ZBX_ACTIVESERVERS | ||
| - | - name: ZBX_DEBUGLEVEL | ||
| - | - name: ZBX_TIMEOUT | ||
| - | - name: ZBX_LOADMODULE | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-agent | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: zabbix-agent | ||
| - | protocol: TCP | ||
| - | resources: | ||
| - | limits: | ||
| - | cpu: 200m | ||
| - | memory: 128Mi | ||
| - | requests: | ||
| - | cpu: 100m | ||
| - | memory: 64Mi | ||
| - | securityContext: | ||
| - | capabilities: | ||
| - | privileged: true | ||
| - | restartPolicy: | ||
| - | securityContext: | ||
| - | </ | ||
| - | |||
| - | <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: | ||
| - | 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 | ||
| - | </ | ||
| - | |||
| - | ==== 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: " | ||
| - | - name: ZBX_HOSTNAME | ||
| - | value: zabbix-proxy | ||
| - | - name: ZBX_SERVER_HOST | ||
| - | value: zabbix-server | ||
| - | - name: ZBX_SERVER_PORT | ||
| - | value: " | ||
| - | - name: ZBX_ENABLE_SNMP_TRAPS | ||
| - | value: " | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-proxy | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: zabbix-trapper | ||
| - | protocol: TCP | ||
| - | resources: {} | ||
| - | securityContext: | ||
| - | capabilities: | ||
| - | privileged: false | ||
| - | volumeMounts: | ||
| - | - mountPath: / | ||
| - | name: zabbix-snmptraps | ||
| - | readOnly: true | ||
| - | - image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-snmptraps | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: snmp-trap | ||
| - | protocol: UDP | ||
| - | resources: | ||
| - | limits: | ||
| - | cpu: 250m | ||
| - | memory: 256M | ||
| - | requests: | ||
| - | cpu: 150m | ||
| - | memory: 128M | ||
| - | securityContext: | ||
| - | capabilities: | ||
| - | privileged: false | ||
| - | volumeMounts: | ||
| - | - mountPath: / | ||
| - | name: zabbix-snmptraps | ||
| - | - env: | ||
| - | - name: ZBX_HOSTNAME | ||
| - | value: zabbix-agent | ||
| - | - name: ZBX_SERVER_HOST | ||
| - | value: zabbix-proxy | ||
| - | - name: ZBX_SERVER_PORT | ||
| - | value: " | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-agent | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: zabbix-agent | ||
| - | protocol: TCP | ||
| - | resources: | ||
| - | limits: | ||
| - | cpu: 200m | ||
| - | memory: 128Mi | ||
| - | requests: | ||
| - | cpu: 100m | ||
| - | memory: 64Mi | ||
| - | securityContext: | ||
| - | capabilities: | ||
| - | privileged: true | ||
| - | restartPolicy: | ||
| - | securityContext: | ||
| - | volumes: | ||
| - | - emptyDir: {} | ||
| - | name: zabbix-snmptraps | ||
| - | </ | ||
| - | |||
| - | <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: | ||
| - | 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 | ||
| - | </ | ||
| - | ==== 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: " | ||
| - | - name: DB_SERVER_HOST | ||
| - | value: pgsql.juntotelecom.com.br | ||
| - | - name: DB_SERVER_PORT | ||
| - | value: " | ||
| - | - name: POSTGRES_USER | ||
| - | value: zabbix | ||
| - | - name: POSTGRES_PASSWORD | ||
| - | valueFrom: | ||
| - | secretKeyRef: | ||
| - | key: db-zbx-pass | ||
| - | name: pgsql-secret | ||
| - | - name: POSTGRES_DB | ||
| - | value: zabbix | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-web | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: zabbix-web | ||
| - | protocol: TCP | ||
| - | resources: {} | ||
| - | restartPolicy: | ||
| - | securityContext: | ||
| - | </ | ||
| - | |||
| - | <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: | ||
| - | ports: | ||
| - | - name: zabbix-web | ||
| - | nodePort: 30162 | ||
| - | port: 80 | ||
| - | protocol: TCP | ||
| - | targetPort: 8080 | ||
| - | selector: | ||
| - | app: zabbix-web | ||
| - | type: NodePort | ||
| - | </ | ||
| - | |||
| - | ===== 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: | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: postgres | ||
| - | protocol: TCP | ||
| - | env: | ||
| - | - name: POSTGRES_USER | ||
| - | value: zabbix | ||
| - | - name: POSTGRES_PASSWORD | ||
| - | value: zabbix | ||
| - | - name: ENABLE_TIMESCALEDB | ||
| - | value: " | ||
| - | volumeMounts: | ||
| - | - name: data | ||
| - | mountPath: / | ||
| - | |||
| - | - name: zabbix-server | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | 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/ | ||
| - | imagePullPolicy: | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | 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/ | ||
| - | |||
| - | - name: zabbix-proxy | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: zabbix-trapper | ||
| - | protocol: TCP | ||
| - | env: | ||
| - | - name: ZBX_HOSTNAME | ||
| - | value: zabbix-proxy | ||
| - | - name: ZBX_SERVER_HOST | ||
| - | value: localhost | ||
| - | - name: ZBX_ENABLE_SNMP_TRAPS | ||
| - | value: " | ||
| - | - name: ZBX_VMWARETIMEOUT | ||
| - | value: " | ||
| - | - name: ZBX_STARTVMWARECOLLECTORS | ||
| - | value: " | ||
| - | - name: ZBX_VMWARECACHESIZE | ||
| - | value: 128M | ||
| - | - name: ZBX_VMWAREFREQUENCY | ||
| - | value: " | ||
| - | - name: ZBX_VMWAREPERFFREQUENCY | ||
| - | value: " | ||
| - | volumeMounts: | ||
| - | - name: snmptraps | ||
| - | mountPath: / | ||
| - | readOnly: true | ||
| - | - name: externalscripts | ||
| - | mountPath: / | ||
| - | readOnly: true | ||
| - | - name: mibs | ||
| - | mountPath: / | ||
| - | readOnly: true | ||
| - | |||
| - | - name: zabbix-agent | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: zabbix-agent | ||
| - | protocol: TCP | ||
| - | env: | ||
| - | - name: ZBX_SERVER_HOST | ||
| - | value: localhost | ||
| - | securityContext: | ||
| - | privileged: true | ||
| - | |||
| - | - name: zabbix-snmptraps | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: snmp-trap | ||
| - | protocol: UDP | ||
| - | volumeMounts: | ||
| - | - name: snmptraps | ||
| - | mountPath: / | ||
| - | - name: mibs | ||
| - | mountPath: / | ||
| - | |||
| - | volumes: | ||
| - | - name: data | ||
| - | persistentVolumeClaim: | ||
| - | claimName: data | ||
| - | - name: mibs | ||
| - | persistentVolumeClaim: | ||
| - | claimName: mibs | ||
| - | - name: externalscripts | ||
| - | persistentVolumeClaim: | ||
| - | claimName: externalscripts | ||
| - | - name: snmptraps | ||
| - | persistentVolumeClaim: | ||
| - | claimName: snmptraps | ||
| - | </ | ||
| - | |||
| - | ==== 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: " | ||
| - | image: postgres:14 | ||
| - | imagePullPolicy: | ||
| - | name: postgres | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: postgres | ||
| - | protocol: TCP | ||
| - | resources: {} | ||
| - | volumeMounts: | ||
| - | - mountPath: / | ||
| - | 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/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-server | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | 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/ | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-web | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | 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: " | ||
| - | - name: ZBX_VMWARETIMEOUT | ||
| - | value: " | ||
| - | - name: ZBX_STARTVMWARECOLLECTORS | ||
| - | value: " | ||
| - | - name: ZBX_VMWARECACHESIZE | ||
| - | value: 128M | ||
| - | - name: ZBX_VMWAREFREQUENCY | ||
| - | value: " | ||
| - | - name: ZBX_VMWAREPERFFREQUENCY | ||
| - | value: " | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-proxy | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: zabbix-trapper | ||
| - | protocol: TCP | ||
| - | resources: {} | ||
| - | volumeMounts: | ||
| - | - mountPath: / | ||
| - | name: snmptraps | ||
| - | readOnly: true | ||
| - | - mountPath: / | ||
| - | name: externalscripts | ||
| - | readOnly: true | ||
| - | - mountPath: / | ||
| - | name: mibs | ||
| - | readOnly: true | ||
| - | - env: | ||
| - | - name: ZBX_SERVER_HOST | ||
| - | value: localhost | ||
| - | image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-agent | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: zabbix-agent | ||
| - | protocol: TCP | ||
| - | resources: {} | ||
| - | securityContext: | ||
| - | privileged: true | ||
| - | - image: zabbix/ | ||
| - | imagePullPolicy: | ||
| - | name: zabbix-snmptraps | ||
| - | ports: | ||
| - | - containerPort: | ||
| - | name: snmp-trap | ||
| - | protocol: UDP | ||
| - | resources: {} | ||
| - | volumeMounts: | ||
| - | - mountPath: / | ||
| - | name: snmptraps | ||
| - | - mountPath: / | ||
| - | name: mibs | ||
| - | dnsPolicy: ClusterFirst | ||
| - | restartPolicy: | ||
| - | volumes: | ||
| - | - name: data | ||
| - | persistentVolumeClaim: | ||
| - | claimName: data | ||
| - | - name: mibs | ||
| - | persistentVolumeClaim: | ||
| - | claimName: mibs | ||
| - | - name: externalscripts | ||
| - | persistentVolumeClaim: | ||
| - | claimName: externalscripts | ||
| - | - name: snmptraps | ||
| - | persistentVolumeClaim: | ||
| - | claimName: snmptraps | ||
| - | </ | ||
| - | |||
| - | ==== PVC ==== | ||
| - | <file yaml> | ||
| - | apiVersion: v1 | ||
| - | kind: PersistentVolumeClaim | ||
| - | metadata: | ||
| - | name: data | ||
| - | namespace: default | ||
| - | spec: | ||
| - | accessModes: | ||
| - | - ReadWriteMany | ||
| - | resources: | ||
| - | requests: | ||
| - | storage: 8Gi | ||
| - | storageClassName: | ||
| - | |||
| - | --- | ||
| - | apiVersion: v1 | ||
| - | kind: PersistentVolumeClaim | ||
| - | metadata: | ||
| - | name: mibs | ||
| - | namespace: default | ||
| - | spec: | ||
| - | accessModes: | ||
| - | - ReadWriteMany | ||
| - | resources: | ||
| - | requests: | ||
| - | storage: 1Gi | ||
| - | storageClassName: | ||
| - | |||
| - | --- | ||
| - | apiVersion: v1 | ||
| - | kind: PersistentVolumeClaim | ||
| - | metadata: | ||
| - | name: externalscripts | ||
| - | namespace: default | ||
| - | spec: | ||
| - | accessModes: | ||
| - | - ReadWriteMany | ||
| - | resources: | ||
| - | requests: | ||
| - | storage: 1Gi | ||
| - | storageClassName: | ||
| - | |||
| - | --- | ||
| - | apiVersion: v1 | ||
| - | kind: PersistentVolumeClaim | ||
| - | metadata: | ||
| - | name: snmptraps | ||
| - | namespace: default | ||
| - | spec: | ||
| - | accessModes: | ||
| - | - ReadWriteMany | ||
| - | resources: | ||
| - | requests: | ||
| - | storage: 1Gi | ||
| - | storageClassName: | ||
| - | </ | ||
zabbix_deploy.1753560545.txt.gz · Last modified: by wikiadm
