Helm/Zabbix: Difference between revisions
Jump to navigation
Jump to search
Created page with "==References== {|class='wikitable mw-collapsible' !scope='col' style='text-align:left' colspan='3'| References |- |valign='top' style='width:33%'| * Helm » External Secrets Operator * Helm » Prometheus Stack * Helm » Cert Manager * Helm » Prometheus * Helm » Nexus HA * Helm » Grafana * Helm » Harbor * Helm/Pi-H..." |
|||
| (26 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
{|class='wikitable' | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
helm repo add zabbix-community https://zabbix-community.github.io/helm-zabbix | |||
helm repo update && helm repo list | |||
kubectl config get-contexts | |||
</syntaxhighlight> | |||
|valign='top' style='width:50%'| | |||
|- | |||
|valign='top' colspan='2'| | |||
{|class='wikitable mw-collapsible mw-collapsed' | |||
!scope='col' style='text-align:left'| | |||
Diagram | |||
|- | |||
|valign='top'| | |||
<kroki lang='plantuml'> | |||
@startuml | |||
!theme plain | |||
' Styling for Transparency and Layout | |||
skinparam backgroundColor transparent | |||
skinparam actorStyle awesome | |||
skinparam rectangle { | |||
BackgroundColor<<Cluster>> #F0F7FF | |||
BorderColor<<Cluster>> #0052CC | |||
} | |||
package "External Network" { | |||
[Zabbix Server] as ZS | |||
database "Database" as DB | |||
ZS -down-> DB | |||
} | |||
rectangle "Kubernetes Cluster" <<Cluster>> { | |||
package "Monitoring Namespace" { | |||
[Zabbix Proxy] as ZP | |||
[kube-state-metrics] as KSM | |||
} | |||
node "Node A" { | |||
[Zabbix Agent] as ZA1 | |||
} | |||
node "Node B" { | |||
[Zabbix Agent] as ZA2 | |||
} | |||
interface "K8s API" as API | |||
} | |||
' Data Flow Logic | |||
ZP -up-> ZS : (1) Push Metrics (Port 10051) | |||
API -down-> ZP : (2) Discovery | |||
KSM -right-> ZP : (3) Pod/Job States | |||
ZA1 -up-> ZP : (4) Node Stats | |||
ZA2 -up-> ZP : (4) Node Stats | |||
@enduml | |||
</kroki> | |||
|} | |||
|} | |||
==Helm » Context== | |||
{|class='wikitable mw-collapsible' | |||
!scope='col' style='text-align:left' colspan='2'| | |||
Helm » Context | |||
|- | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
export KUBECONFIG="${HOME}/.kube/aws-kubeconfig.yaml" | |||
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml" | |||
export KUBECONFIG="${HOME}/.kube/lke-kubeconfig.yaml" | |||
export KUBECONFIG="${HOME}/.kube/config" | |||
</syntaxhighlight> | |||
|valign='top' style='width:50%'| | |||
|} | |||
==Helm » Install== | |||
{|class='wikitable mw-collapsible' | |||
!scope='col' style='text-align:left' colspan='2'| | |||
Helm » Install | |||
|- | |||
|valign='top' colspan='2'| | |||
<syntaxhighlight lang='bash'> | |||
helm show values zabbix-community/zabbix --version=7.0.11|less | |||
helm show values zabbix-community/zabbix --version=7.0.12|less | |||
</syntaxhighlight> | |||
|- | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
export KUBECONFIG="${HOME}/.kube/shahed-ab-kubeconfig.yaml" | |||
kubectl create ns zabbix-monitoring-system || true | |||
</syntaxhighlight> | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl get ns|grep zabbix-monitoring-system | |||
kubectl delete ns zabbix-monitoring-system || true | |||
</syntaxhighlight> | |||
|- | |||
!scope='col'| Secret | |||
!scope='col'| Notes | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='ini'> | |||
cat <<'ENV' | \ | |||
kubectl -n zabbix-monitoring-system create secret generic postgres \ | |||
--from-env-file=/dev/stdin --dry-run=client -o=yaml | kubectl apply -f - | |||
host=zabbix-postgresql.zabbix-monitoring-system | |||
password=AbO330a$0FRv4XxY | |||
dbname=shahed_zabbix_ops | |||
user=shahed_zabbix_ops | |||
port=5432 | |||
ENV | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n zabbix-monitoring-system get Secret postgres -o=yaml | |||
kubectl -n zabbix-monitoring-system delete Secret postgres | |||
echo "$(cat /dev/urandom|tr -dc 'A-Za-z0-9'|head -c 16)" | |||
</syntaxhighlight> | |||
|- | |||
!scope='col'| Install | |||
!scope='col'| Notes | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='yaml'> | |||
cat <<'YML' | \ | |||
helm -n=zabbix-monitoring-system upgrade \ | |||
-i zabbix zabbix-community/zabbix --version=7.0.12 -f - | |||
--- | |||
nameOverride: zabbix | |||
fullnameOverride: zabbix | |||
zabbixImageTag: ubuntu-7.0.16 | |||
postgresAccess: | |||
existingSecretName: postgres | |||
zabbixServer: | |||
enabled: true | |||
zabbixServerHA: | |||
enabled: false | |||
dbCreateUpgradeJob: | |||
image: | |||
repository: ghcr.io/zabbix-community/zabbix-server-create-upgrade-db | |||
replicaCount: 1 | |||
image: | |||
repository: zabbix/zabbix-server-pgsql | |||
ingress: | |||
enabled: true | |||
annotations: | |||
kubernetes.io/ingress.class: nginx | |||
hosts: | |||
- host: zabbix.shahed.biz.ops | |||
paths: | |||
- path: / | |||
pathType: ImplementationSpecific | |||
YML | |||
</syntaxhighlight> | |||
|valign='top'| | |||
|- | |||
!scope='col'| Status | |||
!scope='col'| Verify | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
helm -n=zabbix-monitoring-system status zabbix | |||
helm -n=zabbix-monitoring-system get manifest zabbix | |||
</syntaxhighlight> | |||
|valign='top'| | |||
telnet zabbix.shahed.biz.ops 80 | |||
setsid open http://zabbix.shahed.biz.ops >/dev/null 2>&1 & | |||
|} | |||
==Helm » Ingress== | |||
{|class='wikitable mw-collapsible mw-collapsed' | |||
!scope='col' style='text-align:left' colspan='2'| | |||
Helm » Ingress | |||
|- | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='yaml'> | |||
cat <<'YML' | \ | |||
kubectl -n zabbix-monitoring-system apply -f - | |||
--- | |||
apiVersion: cert-manager.io/v1 | |||
kind: Certificate | |||
metadata: | |||
name: zabbix-cert | |||
namespace: zabbix-monitoring-system | |||
spec: | |||
secretName: zabbix-cert | |||
commonName: zabbix.shahed.biz.ops | |||
dnsNames: | |||
- zabbix.shahed.biz.ops | |||
duration: 8760h | |||
renewBefore: 720h | |||
privateKey: | |||
size: 256 | |||
encoding: PKCS8 | |||
algorithm: ECDSA | |||
rotationPolicy: Always | |||
usages: | |||
- digital signature | |||
- key encipherment | |||
- server auth | |||
- client auth | |||
subject: | |||
countries: ["BD"] | |||
provinces: ["Dhaka"] | |||
postalCodes: ["1500"] | |||
localities: ["Munshiganj"] | |||
organizations: ["Shahed, Inc."] | |||
organizationalUnits: ["zabbix.shahed.biz.ops"] | |||
streetAddresses: ["256 Khal East, Passport Office"] | |||
issuerRef: | |||
name: shahed-ecc-sub-ca-2025-k8s | |||
kind: ClusterIssuer | |||
YML | |||
</syntaxhighlight> | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
cat <<'CRT' | \ | |||
sudo tee /usr/local/share/ca-certificates/Shahed_ECC_Root_CA_2025.crt >/dev/null | |||
-----BEGIN CERTIFICATE----- | |||
MIICVzCCAf0CFGUKRHOSLD3pqFU50HJvLeqYUPq6MAoGCCqGSM49BAMCMIGtMQsw | |||
CQYDVQQGEwJCRDEOMAwGA1UECAwFRGhha2ExEzARBgNVBAcMCk11bnNoaWdhbmox | |||
FTATBgNVBAoMDFNoYWhlZCwgSW5jLjEgMB4GA1UECwwXU2hhaGVkX0VDQ19Sb290 | |||
X0NBXzIwMjUxIDAeBgNVBAMMF1NoYWhlZF9FQ0NfUm9vdF9DQV8yMDI1MR4wHAYJ | |||
KoZIhvcNAQkBFg9pbmZvQHNoYWhlZC5iaXowHhcNMjUwODIzMDk1NzMxWhcNNDUw | |||
ODIzMDk1NzMxWjCBrTELMAkGA1UEBhMCQkQxDjAMBgNVBAgMBURoYWthMRMwEQYD | |||
VQQHDApNdW5zaGlnYW5qMRUwEwYDVQQKDAxTaGFoZWQsIEluYy4xIDAeBgNVBAsM | |||
F1NoYWhlZF9FQ0NfUm9vdF9DQV8yMDI1MSAwHgYDVQQDDBdTaGFoZWRfRUNDX1Jv | |||
b3RfQ0FfMjAyNTEeMBwGCSqGSIb3DQEJARYPaW5mb0BzaGFoZWQuYml6MFkwEwYH | |||
KoZIzj0CAQYIKoZIzj0DAQcDQgAEbuTaY9T08dgixHd9zvDCfuVODsZJDLcdpNB1 | |||
38haHzpnfsl0fvKVfJP1nYwrKwskBDTWPDYC03nIHJJxi9js+TAKBggqhkjOPQQD | |||
AgNIADBFAiBUPr4rlKCuAD6FnoyZd/XKD/PvbzafUd4ZnRPFvSw3gQIhAMI+5v7a | |||
ea5K8PaGppAIi/55yHqYlXLgaMB4ohu3OsGw | |||
-----END CERTIFICATE----- | |||
CRT | |||
sudo update-ca-certificates --fresh | |||
sudo update-ca-certificates | |||
</syntaxhighlight> | |||
'''Shahed_ECC_Root_CA_2025''' » Firefox » Settings » Certificates » View Certificates » Import | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n zabbix-monitoring-system get Secret zabbix-cert -o=yaml | |||
kubectl -n zabbix-monitoring-system get Certificate zabbix-cert -o=yaml | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n zabbix-monitoring-system delete Secret zabbix-cert -o=yaml | |||
kubectl -n zabbix-monitoring-system delete Certificate zabbix-cert -o=yaml | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n cert-manager rollout restart deployment cert-manager-webhook | |||
kubectl get ValidatingWebhookConfiguration cert-manager-webhook | |||
</syntaxhighlight> | |||
* [[Helm/Cert_Manager#Cert Manager » Webhook » Fixes|Skipped » Find More 👉 Webhook » Fixes]] | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='yaml'> | |||
cat <<'YML' | \ | |||
kubectl -n zabbix-monitoring-system patch ingress/zabbix --patch-file=/dev/stdin | |||
--- | |||
metadata: | |||
annotations: | |||
cert-manager.io/cluster-issuer: shahed-ecc-sub-ca-2025-k8s | |||
spec: | |||
tls: | |||
- hosts: | |||
- zabbix.shahed.biz.ops | |||
secretName: zabbix-cert | |||
YML | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='yaml'> | |||
cat <<'YML' | \ | |||
kubectl -n zabbix-monitoring-system patch ingress/zabbix --patch-file=/dev/stdin | |||
--- | |||
metadata: | |||
annotations: | |||
cert-manager.io/cluster-issuer: null | |||
spec: | |||
tls: null | |||
YML | |||
</syntaxhighlight> | |||
|- | |||
!scope='col'| Telnet | |||
!scope='col'| Browse | |||
|- | |||
|valign='top'| | |||
telnet zabbix.shahed.biz.ops 80 | |||
telnet zabbix.shahed.biz.ops 443 | |||
|valign='top'| | |||
setsid open http://zabbix.shahed.biz.ops >/dev/null 2>&1 & | |||
setsid open https://zabbix.shahed.biz.ops >/dev/null 2>&1 & | |||
|} | |||
==Helm » Scaling== | |||
{|class='wikitable mw-collapsible mw-collapsed' | |||
!scope='col' style='text-align:left' colspan='2'| | |||
Helm » Scaling | |||
|- | |||
!scope='col' style='width:50%'| Scale » Down | |||
!scope='col' style='width:50%'| Scale » Up | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system \ | |||
scale deploy/zabbix-zabbix-webservice --replicas=0 | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system \ | |||
scale deploy/zabbix-zabbix-webservice --replicas=1 | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system \ | |||
scale deploy/zabbix-zabbix-server --replicas=0 | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system \ | |||
scale deploy/zabbix-zabbix-server --replicas=1 | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system \ | |||
scale deploy/zabbix-zabbix-web --replicas=0 | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system \ | |||
scale deploy/zabbix-zabbix-web --replicas=1 | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system \ | |||
scale sts/zabbix-postgresql --replicas=0 | |||
</syntaxhighlight> | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system \ | |||
scale sts/zabbix-postgresql --replicas=1 | |||
</syntaxhighlight> | |||
|} | |||
==Helm » Debug== | |||
{|class='wikitable mw-collapsible' | |||
!scope='col' style='text-align:left'| | |||
Helm » Debug | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -- psql -p5432 -U shahed_zabbix_ops -d shahed_zabbix_ops | |||
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -- bash -c 'printenv|grep -i postgres_' | |||
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -- bash -c 'cat /etc/hosts' | |||
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -- bash | |||
psql -hzabbix-postgresql-0 -p5432 -U shahed_zabbix_ops | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-zabbix-webservice -c zabbix-webservice -- bash | |||
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-webservice -c zabbix-webservice | |||
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-zabbix-server -c zabbix-server -- bash | |||
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-server -c zabbix-server | |||
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -c postgresql -- bash | |||
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-postgresql -c postgresql | |||
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-zabbix-web -c zabbix-web -- bash | |||
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-web -c zabbix-web | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system get Pod -o=yaml|yq -P '.items[].spec.containers[].name' | |||
kubectl -n=zabbix-monitoring-system get Pod -o=yaml|yq -P '.items[].metadata.labels' | |||
kubectl -n=zabbix-monitoring-system get Ingress -o=yaml|yq -P '.items[].metadata.name' | |||
kubectl -n=zabbix-monitoring-system get Service -o=yaml|yq -P '.items[].metadata.name' | |||
kubectl -n=zabbix-monitoring-system get deploy -o=yaml|yq -P '.items[].metadata.name' | |||
kubectl -n=zabbix-monitoring-system get sts -o=yaml|yq -P '.items[].metadata.name' | |||
kubectl -n=zabbix-monitoring-system get Pod --show-labels | |||
kubectl -n=zabbix-monitoring-system get Service | |||
</syntaxhighlight> | |||
|- | |||
|valign='top'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-webservice | |||
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-server | |||
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-postgresql | |||
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-web | |||
</syntaxhighlight> | |||
|} | |||
==Helm » Uninstall== | |||
{|class='wikitable mw-collapsible mw-collapsed' | |||
!scope='col' style='text-align:left' colspan='2'| | |||
Helm » Uninstall | |||
|- | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
helm -n=zabbix-monitoring-system status zabbix | |||
helm -n=zabbix-monitoring-system get all zabbix | |||
helm -n=zabbix-monitoring-system uninstall zabbix | |||
</syntaxhighlight> | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system delete pvc --all | |||
kubectl delete ns zabbix-monitoring-system | |||
kubectl delete pv zabbix-postgresql-data-0 | |||
</syntaxhighlight> | |||
|} | |||
==Playground== | |||
{|class='wikitable mw-collapsible mw-collapsed' | |||
!scope='col' style='text-align:left' colspan='2'| | |||
Playground | |||
|- | |||
|valign='top' colspan='2'| | |||
<syntaxhighlight lang='bash'> | |||
helm -n=zabbix-monitoring-system install zabbix zabbix-community/zabbix --version=7.0.12 | |||
helm -n=zabbix-monitoring-system upgrade -i zabbix zabbix-community/zabbix --version=7.0.12 | |||
helm show values zabbix-community/zabbix --version=7.0.12|less | |||
</syntaxhighlight> | |||
|- | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system delete all --all | |||
kubectl -n=zabbix-monitoring-system delete ing --all | |||
kubectl -n=zabbix-monitoring-system delete sts --all | |||
</syntaxhighlight> | |||
|valign='top' style='width:50%'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl delete pv zabbix-postgresql-data-0 | |||
kubectl -n=zabbix-monitoring-system delete svc --all | |||
kubectl -n=zabbix-monitoring-system delete pvc --all | |||
</syntaxhighlight> | |||
|- | |||
|valign='top' colspan='2'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system rollout history deploy/zabbix-zabbix-web | |||
kubectl -n=zabbix-monitoring-system rollout restart deploy/zabbix-zabbix-web | |||
kubectl -n=zabbix-monitoring-system rollout status deploy/zabbix-zabbix-web | |||
</syntaxhighlight> | |||
|- | |||
|valign='top' colspan='2'| | |||
<syntaxhighlight lang='bash'> | |||
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -- psql -p5432 -U shahed_zabbix_ops | |||
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-postgresql | |||
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-web | |||
</syntaxhighlight> | |||
|} | |||
==References== | ==References== | ||
{|class='wikitable mw-collapsible' | {|class='wikitable mw-collapsible' | ||
| Line 5: | Line 487: | ||
|- | |- | ||
|valign='top' style='width:33%'| | |valign='top' style='width:33%'| | ||
* [[Helm/External Secrets Operator|Helm » External Secrets Operator]] | * [[Helm/External Secrets Operator|Helm » External Secrets Operator]] | ||
* [[Helm/Prometheus Stack|Helm » Prometheus Stack]] | * [[Helm/Prometheus Stack|Helm » Prometheus Stack]] | ||
| Line 13: | Line 496: | ||
* [[Helm/Harbor|Helm » Harbor]] | * [[Helm/Harbor|Helm » Harbor]] | ||
* [[Helm/Pi-Hole|Helm » Pi-Hole]] | * [[Helm/Pi-Hole|Helm » Pi-Hole]] | ||
* [https://artifacthub.io/packages/helm/zabbix-community/zabbix Helm » Zabbix] | |||
* [[Helm]] | * [[Helm]] | ||
|valign='top' style='width:34%'| | |valign='top' style='width:34%'| | ||
* [https://git.zabbix.com/projects/ZT/repos/kubernetes-helm/browse Helm » Zabbix » Official] | |||
|valign='top' style='width:33%'| | |valign='top' style='width:33%'| | ||
Latest revision as of 09:54, 26 January 2026
helm repo add zabbix-community https://zabbix-community.github.io/helm-zabbix
helm repo update && helm repo list
kubectl config get-contexts
|
|||
| |||
Helm » Context
|
Helm » Context | |
|---|---|
export KUBECONFIG="${HOME}/.kube/aws-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/gcp-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/lke-kubeconfig.yaml"
export KUBECONFIG="${HOME}/.kube/config"
|
|
Helm » Install
|
Helm » Install | |
|---|---|
helm show values zabbix-community/zabbix --version=7.0.11|less
helm show values zabbix-community/zabbix --version=7.0.12|less
| |
export KUBECONFIG="${HOME}/.kube/shahed-ab-kubeconfig.yaml"
kubectl create ns zabbix-monitoring-system || true
|
kubectl get ns|grep zabbix-monitoring-system
kubectl delete ns zabbix-monitoring-system || true
|
| Secret | Notes |
cat <<'ENV' | \
kubectl -n zabbix-monitoring-system create secret generic postgres \
--from-env-file=/dev/stdin --dry-run=client -o=yaml | kubectl apply -f -
host=zabbix-postgresql.zabbix-monitoring-system
password=AbO330a$0FRv4XxY
dbname=shahed_zabbix_ops
user=shahed_zabbix_ops
port=5432
ENV
|
kubectl -n zabbix-monitoring-system get Secret postgres -o=yaml
kubectl -n zabbix-monitoring-system delete Secret postgres
echo "$(cat /dev/urandom|tr -dc 'A-Za-z0-9'|head -c 16)"
|
| Install | Notes |
cat <<'YML' | \
helm -n=zabbix-monitoring-system upgrade \
-i zabbix zabbix-community/zabbix --version=7.0.12 -f -
---
nameOverride: zabbix
fullnameOverride: zabbix
zabbixImageTag: ubuntu-7.0.16
postgresAccess:
existingSecretName: postgres
zabbixServer:
enabled: true
zabbixServerHA:
enabled: false
dbCreateUpgradeJob:
image:
repository: ghcr.io/zabbix-community/zabbix-server-create-upgrade-db
replicaCount: 1
image:
repository: zabbix/zabbix-server-pgsql
ingress:
enabled: true
annotations:
kubernetes.io/ingress.class: nginx
hosts:
- host: zabbix.shahed.biz.ops
paths:
- path: /
pathType: ImplementationSpecific
YML
|
|
| Status | Verify |
helm -n=zabbix-monitoring-system status zabbix
helm -n=zabbix-monitoring-system get manifest zabbix
|
telnet zabbix.shahed.biz.ops 80 setsid open http://zabbix.shahed.biz.ops >/dev/null 2>&1 & |
Helm » Ingress
|
Helm » Ingress | |
|---|---|
cat <<'YML' | \
kubectl -n zabbix-monitoring-system apply -f -
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: zabbix-cert
namespace: zabbix-monitoring-system
spec:
secretName: zabbix-cert
commonName: zabbix.shahed.biz.ops
dnsNames:
- zabbix.shahed.biz.ops
duration: 8760h
renewBefore: 720h
privateKey:
size: 256
encoding: PKCS8
algorithm: ECDSA
rotationPolicy: Always
usages:
- digital signature
- key encipherment
- server auth
- client auth
subject:
countries: ["BD"]
provinces: ["Dhaka"]
postalCodes: ["1500"]
localities: ["Munshiganj"]
organizations: ["Shahed, Inc."]
organizationalUnits: ["zabbix.shahed.biz.ops"]
streetAddresses: ["256 Khal East, Passport Office"]
issuerRef:
name: shahed-ecc-sub-ca-2025-k8s
kind: ClusterIssuer
YML
|
cat <<'CRT' | \
sudo tee /usr/local/share/ca-certificates/Shahed_ECC_Root_CA_2025.crt >/dev/null
-----BEGIN CERTIFICATE-----
MIICVzCCAf0CFGUKRHOSLD3pqFU50HJvLeqYUPq6MAoGCCqGSM49BAMCMIGtMQsw
CQYDVQQGEwJCRDEOMAwGA1UECAwFRGhha2ExEzARBgNVBAcMCk11bnNoaWdhbmox
FTATBgNVBAoMDFNoYWhlZCwgSW5jLjEgMB4GA1UECwwXU2hhaGVkX0VDQ19Sb290
X0NBXzIwMjUxIDAeBgNVBAMMF1NoYWhlZF9FQ0NfUm9vdF9DQV8yMDI1MR4wHAYJ
KoZIhvcNAQkBFg9pbmZvQHNoYWhlZC5iaXowHhcNMjUwODIzMDk1NzMxWhcNNDUw
ODIzMDk1NzMxWjCBrTELMAkGA1UEBhMCQkQxDjAMBgNVBAgMBURoYWthMRMwEQYD
VQQHDApNdW5zaGlnYW5qMRUwEwYDVQQKDAxTaGFoZWQsIEluYy4xIDAeBgNVBAsM
F1NoYWhlZF9FQ0NfUm9vdF9DQV8yMDI1MSAwHgYDVQQDDBdTaGFoZWRfRUNDX1Jv
b3RfQ0FfMjAyNTEeMBwGCSqGSIb3DQEJARYPaW5mb0BzaGFoZWQuYml6MFkwEwYH
KoZIzj0CAQYIKoZIzj0DAQcDQgAEbuTaY9T08dgixHd9zvDCfuVODsZJDLcdpNB1
38haHzpnfsl0fvKVfJP1nYwrKwskBDTWPDYC03nIHJJxi9js+TAKBggqhkjOPQQD
AgNIADBFAiBUPr4rlKCuAD6FnoyZd/XKD/PvbzafUd4ZnRPFvSw3gQIhAMI+5v7a
ea5K8PaGppAIi/55yHqYlXLgaMB4ohu3OsGw
-----END CERTIFICATE-----
CRT
sudo update-ca-certificates --fresh
sudo update-ca-certificates
Shahed_ECC_Root_CA_2025 » Firefox » Settings » Certificates » View Certificates » Import kubectl -n zabbix-monitoring-system get Secret zabbix-cert -o=yaml
kubectl -n zabbix-monitoring-system get Certificate zabbix-cert -o=yaml
kubectl -n zabbix-monitoring-system delete Secret zabbix-cert -o=yaml
kubectl -n zabbix-monitoring-system delete Certificate zabbix-cert -o=yaml
kubectl -n cert-manager rollout restart deployment cert-manager-webhook
kubectl get ValidatingWebhookConfiguration cert-manager-webhook
|
cat <<'YML' | \
kubectl -n zabbix-monitoring-system patch ingress/zabbix --patch-file=/dev/stdin
---
metadata:
annotations:
cert-manager.io/cluster-issuer: shahed-ecc-sub-ca-2025-k8s
spec:
tls:
- hosts:
- zabbix.shahed.biz.ops
secretName: zabbix-cert
YML
|
cat <<'YML' | \
kubectl -n zabbix-monitoring-system patch ingress/zabbix --patch-file=/dev/stdin
---
metadata:
annotations:
cert-manager.io/cluster-issuer: null
spec:
tls: null
YML
|
| Telnet | Browse |
telnet zabbix.shahed.biz.ops 80 telnet zabbix.shahed.biz.ops 443 |
setsid open http://zabbix.shahed.biz.ops >/dev/null 2>&1 & setsid open https://zabbix.shahed.biz.ops >/dev/null 2>&1 & |
Helm » Scaling
|
Helm » Scaling | |
|---|---|
| Scale » Down | Scale » Up |
kubectl -n=zabbix-monitoring-system \
scale deploy/zabbix-zabbix-webservice --replicas=0
|
kubectl -n=zabbix-monitoring-system \
scale deploy/zabbix-zabbix-webservice --replicas=1
|
kubectl -n=zabbix-monitoring-system \
scale deploy/zabbix-zabbix-server --replicas=0
|
kubectl -n=zabbix-monitoring-system \
scale deploy/zabbix-zabbix-server --replicas=1
|
kubectl -n=zabbix-monitoring-system \
scale deploy/zabbix-zabbix-web --replicas=0
|
kubectl -n=zabbix-monitoring-system \
scale deploy/zabbix-zabbix-web --replicas=1
|
kubectl -n=zabbix-monitoring-system \
scale sts/zabbix-postgresql --replicas=0
|
kubectl -n=zabbix-monitoring-system \
scale sts/zabbix-postgresql --replicas=1
|
Helm » Debug
|
Helm » Debug |
|---|
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -- psql -p5432 -U shahed_zabbix_ops -d shahed_zabbix_ops
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -- bash -c 'printenv|grep -i postgres_'
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -- bash -c 'cat /etc/hosts'
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -- bash
psql -hzabbix-postgresql-0 -p5432 -U shahed_zabbix_ops
|
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-zabbix-webservice -c zabbix-webservice -- bash
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-webservice -c zabbix-webservice
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-zabbix-server -c zabbix-server -- bash
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-server -c zabbix-server
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -c postgresql -- bash
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-postgresql -c postgresql
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-zabbix-web -c zabbix-web -- bash
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-web -c zabbix-web
|
kubectl -n=zabbix-monitoring-system get Pod -o=yaml|yq -P '.items[].spec.containers[].name'
kubectl -n=zabbix-monitoring-system get Pod -o=yaml|yq -P '.items[].metadata.labels'
kubectl -n=zabbix-monitoring-system get Ingress -o=yaml|yq -P '.items[].metadata.name'
kubectl -n=zabbix-monitoring-system get Service -o=yaml|yq -P '.items[].metadata.name'
kubectl -n=zabbix-monitoring-system get deploy -o=yaml|yq -P '.items[].metadata.name'
kubectl -n=zabbix-monitoring-system get sts -o=yaml|yq -P '.items[].metadata.name'
kubectl -n=zabbix-monitoring-system get Pod --show-labels
kubectl -n=zabbix-monitoring-system get Service
|
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-webservice
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-server
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-postgresql
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-web
|
Helm » Uninstall
|
Helm » Uninstall | |
|---|---|
helm -n=zabbix-monitoring-system status zabbix
helm -n=zabbix-monitoring-system get all zabbix
helm -n=zabbix-monitoring-system uninstall zabbix
|
kubectl -n=zabbix-monitoring-system delete pvc --all
kubectl delete ns zabbix-monitoring-system
kubectl delete pv zabbix-postgresql-data-0
|
Playground
|
Playground | |
|---|---|
helm -n=zabbix-monitoring-system install zabbix zabbix-community/zabbix --version=7.0.12
helm -n=zabbix-monitoring-system upgrade -i zabbix zabbix-community/zabbix --version=7.0.12
helm show values zabbix-community/zabbix --version=7.0.12|less
| |
kubectl -n=zabbix-monitoring-system delete all --all
kubectl -n=zabbix-monitoring-system delete ing --all
kubectl -n=zabbix-monitoring-system delete sts --all
|
kubectl delete pv zabbix-postgresql-data-0
kubectl -n=zabbix-monitoring-system delete svc --all
kubectl -n=zabbix-monitoring-system delete pvc --all
|
kubectl -n=zabbix-monitoring-system rollout history deploy/zabbix-zabbix-web
kubectl -n=zabbix-monitoring-system rollout restart deploy/zabbix-zabbix-web
kubectl -n=zabbix-monitoring-system rollout status deploy/zabbix-zabbix-web
| |
kubectl -n=zabbix-monitoring-system exec -it svc/zabbix-postgresql -- psql -p5432 -U shahed_zabbix_ops
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-postgresql
kubectl -n=zabbix-monitoring-system logs -f svc/zabbix-zabbix-web
| |
References
|
References | ||
|---|---|---|