Skip to content
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.

zalando-zmon/zmon-kubernetes

Repository files navigation

ZMON on Kubernetes

For demo purposes provide k8s templates.

Config used is in:

config.yaml

Prepare K8S definitions:

./zmon-k8s.py

Next step is to run the printed commands :)

Minikube

Check that you give your VM enough resources:

minikube start --memory=4000 --cpus=3

Note

PostgreSQL and Cassandra do not use persistent volumes!

Deployment

Create Namespace

kubectl create namespace zmon

If you want use the following command to set the default namespace:

kubectl config set-context minikube --namespace=zmon

Dependencies

kubectl create -f dependencies/cassandra/deployment.yaml
kubectl create -f dependencies/cassandra/service.yaml

kubectl create -f dependencies/kairosdb/deployment.yaml
kubectl create -f dependencies/kairosdb/service.yaml

kubectl create -f dependencies/redis/deployment.yaml
kubectl create -f dependencies/redis/service.yaml

kubectl create -f dependencies/postgresql/deployment.yaml
kubectl create -f dependencies/postgresql/service.yaml

ZMON source download

wget https://github.com/zalando-zmon/zmon-controller/archive/master.zip -O zmon-controller.zip
wget https://github.com/zalando-zmon/zmon-eventlog-service/archive/master.zip -O zmon-eventlog-service.zip

mkdir -p zmon-controller-source
mkdir -p zmon-eventlog-service-source

unzip zmon-controller.zip -d zmon-controller-source
unzip zmon-eventlog-service.zip -d zmon-eventlog-service-source

ZMON Database setup

export POSTGRES_NODE_IP=$(minikube ip)
export POSTGRES_NODE_PORT=31088
export PGPASSWORD={{admin_password}}

psql -h $POSTGRES_NODE_IP -p $POSTGRES_NODE_PORT -U postgres -c "CREATE DATABASE local_zmon_db;" postgres
psql -h $POSTGRES_NODE_IP -p $POSTGRES_NODE_PORT -U postgres -c 'CREATE EXTENSION IF NOT EXISTS hstore;' local_zmon_db
psql -h $POSTGRES_NODE_IP -p $POSTGRES_NODE_PORT -U postgres -c "CREATE ROLE zmon WITH LOGIN PASSWORD '{{postgresql_password}}';" postgres
psql -h $POSTGRES_NODE_IP -p $POSTGRES_NODE_PORT -U postgres -c "ALTER ROLE zmon WITH PASSWORD '{{postgresql_password}}';" postgres

find "zmon-controller-source/zmon-controller-master/database/zmon" -name '*.sql' \
                                   | sort \
                                   | xargs cat \
                                   | psql -h $POSTGRES_NODE_IP -p $POSTGRES_NODE_PORT -U postgres -d local_zmon_db

psql -h $POSTGRES_NODE_IP -p $POSTGRES_NODE_PORT -U postgres -f zmon-eventlog-service-source/zmon-eventlog-service-master/database/eventlog/00_create_schema.sql local_zmon_db

ZMON components

kubectl create -f deployments/zmon-eventlog-service.yaml
kubectl create -f services/zmon-eventlog-service-service.yaml

kubectl create -f deployments/zmon-controller.yaml
kubectl create -f services/zmon-controller-service.yaml

kubectl create -f deployments/zmon-scheduler.yaml
kubectl create -f services/zmon-scheduler-service.yaml

kubectl create -f deployments/zmon-worker.yaml

Connecting

Depending on how you run minikube:

kubectl get pods --namespace zmon
kubectl port-forward <controller pod id> 8443:443  --namespace zmon

GCE LB

Add firewall rule to allow traffic and health check from IP range: 130.211.0.0/22

Releases

No releases published

Packages

No packages published