CULTURE CHANGE

USE ZABBIX IN
KUBERNETES

HELLO!
I am Robert Silva
CKA | Zabbix Trainer | Zabbix Expert
DevOps Engineer at JLCP2

Does Zabbix
work incontainers?

I started using Zabbix incontainers 2 years ago

https://blog.zabbix.com/scaling-zabbix-with-containers/13155/
4How this environment
currently works

5How this environment
currently works

6How this environment
currently works
Using 101 proxies
without any SSH
connection formaintenance.

7

Yes, Zabbix works in containers
But, why do we still have environments in virtual machines?
▸ Maybe because of culture and mainly because of lack of knowledge▹ We can talk about it in other moment.

8

“I won't talk about
the benefits ofKubernetes.

9“My goal is toanswer questions
about how Zabbix
works onKubernetes.
10Our challenge
Zabbix has hundreds ofintegrations like:▸ AWS;▸ Azure;▸ Redis;▸ MongoDB;▸ Kafka;▸ APIs;▸ Prometheus;▸ Kubernetes/Openshift;▸ Others.

Software Engineers, Cloud
Engineers prefer Prometheus
because it is "Cloud Native".
We Zabbix experts must showthat Zabbix is prepared to workwith modern technologies.
Service Discovery and Low Level
Discovery working together isAwesome.

How to start working withkubernetes?

12Required skills
Linux;➢ Networks;➢ Basic shell script;➢ Distributed architecture;➢ High Availability Architecture;➢ How containers work;➢ Container orchestration;○ Docker Swarm, Kubernetes, Openshift.
➢ CI/CD process.
➢13

First steps
Understand what resources we need to Deploy Zabbix in Kubernetes;▸ Create an isolated environment for development, homolog andproduction;▸ It is recommended to have 2 clusters:
1. Development and homolog;
2. Production.
▸ You don't need a dedicated Zabbix cluster, just dedicated nodes.
▸ Define how the Deploy will be done:▹ Gitlab CI/CD, ArgoCD, Harness, Azure Devops and others.
▸Kubernetes objetcs

Kubernetes basics objects to Zabbix

Zabbix Server

Zabbix Frontend

Zabbix Proxy

How does connectivity work?
Zabbix Proxy

External Load Balancer
to TCP connections

Zabbix Server

NGINX Ingress Controller
to HTTP/HTTPS connections

Zabbix Frontend
Ingress resource
Path: zabbix.domain

Two ways to deploy to Kubernetes

Usingmanifest fileUsing helm

Deploy using Kubernetes
manifest files
Namespace: develop

Namespace: homolog

Namespace: production

It is not good. We need to manage 24 yaml file and just need to change some parameters.

How to improve it?
Package manager
aptdnfWhat is helm?
▸The package manager for Kubernetes;▸Provide a reusable facility and serve as a single
point of control;▸Use Helm Rollback to easily revert to an olderversion.

Deploy using Helm

Namespace: develop

Namespace: homolog

Namespace: production

How Helm works?
▸ Helm is based in template files;▸ We need create our templates and definevalues.yaml;

Example Helm values and template112
233values.yaml

templates/deployment.yaml

24

Solution flow

Technologies
involved

Git

Gitlab

CI/CD

ArgoCD

Kubernetes OR OpenShift26

Best practices for working with branches▸Enable protected branches and tags;▸Keep stable branches secure, and force developers to use merge
requests;▸Gitlab example:▹Repo > Settings > Repository > Protected branches or tags.

Basic CI/CD Flow using Git and Gitlab
with secureZabbixAdmin

Folderwith git

choose thebranch

Makechanges

commitRemoterepository

Create newbranch

Merge request

StagebuildpipelineStage
deployCI/CD Flow using Git and Gitlab

Stage nameStage nameStage nameStage nameStage nameStage nameGitlab CI sample code using branches
Become dynamic CI/CD process$CI_PROJECT_PATH: Repository name
$CI_COMMIT_REF_SLUG: Branch
name$CI_PIPELINE_ID: Pipeline ID

Define when this stage should run
In this case only branch is develop orhomolog

Gitlab CD sample codeGitlab CD sample code
Reference to YAML anchor

Reference to YAML anchorGitlab CD sample code
Reference to YAML anchor

Run script to deploy

Result from CI/CD processBenefits of using Git
All centralized environment settings, such as:○ External scripts and AlertScripts;○ odbc.ini and odbcinst.ini;○ All configuration parameters:■ CacheSize, ValueCache, Pollers and others.
➢ View all changes:○ Who changed;○ What changed;○ Because it changed.
➢35Benefits of using CI/CD➢ No manual intervention;➢ Automatic docker image build and update;➢ Automatic setup process.

36

THANKS!
Any questions?
You can find me at:37

Credits
Special thanks to all the people who made and released theseawesome resources for free:▸ Presentation template by SlidesCarnival▸ Illustrations by Sergei Tikhonov▸ Photographs by Unsplash

38