From b22ff9f6ae63fe1d67dbbd2a36d88d78650b67c2 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Sun, 28 Jul 2019 13:44:50 +0200 Subject: [PATCH] simple healthchecks.io monitoring cleanup unused checkup monitoring --- README.md | 16 +++++++++++ checkup.json.example | 44 ------------------------------- contrib/healthchecks-cronjob.yaml | 29 ++++++++++++++++++++ docker-compose.yml | 8 ------ monitoring/Dockerfile | 7 ----- 5 files changed, 45 insertions(+), 59 deletions(-) delete mode 100644 checkup.json.example create mode 100644 contrib/healthchecks-cronjob.yaml delete mode 100644 monitoring/Dockerfile diff --git a/README.md b/README.md index cf4756d..cb3bac3 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,22 @@ Continue with "Odoo PoS configuration" More hardware description and a network diagram: tbd. +## Monitoring + +There are two kinds of monitoring prepared: The cluster itself and the PoS +application. + +### Simple Cluster Healthcheck + +Under `contrib/healthchecks-cronjob.yaml` a simple Kubernetes cronjob is +provided which regularly pings [Healthchecks.io](https://healthchecks.io/). + +A secret with the ping URL needs to be added before the CronJobs does it's work: + +``` +kubectl -n hc create secret generic healthchecks-io --from-literal=HCURL=https://hc-ping.com/MYUUID +``` + ## Backup configuration Example contents of `backup.env`: diff --git a/checkup.json.example b/checkup.json.example deleted file mode 100644 index 486f984..0000000 --- a/checkup.json.example +++ /dev/null @@ -1,44 +0,0 @@ -{ - "checkers": [ - { - "type": "http", - "endpoint_name": "Mikrotik Access Point", - "endpoint_url": "http://192.168.233.1" - }, - { - "type": "http", - "endpoint_name": "Odoo", - "endpoint_url": "http://10.5.0.2:8069" - }, - { - "type": "http", - "endpoint_name": "PosBox", - "endpoint_url": "http://10.5.0.3:8069" - }, - { - "type": "tcp", - "endpoint_name": "Printer 1", - "endpoint_url": "192.168.233.3:80" - }, - { - "type": "tcp", - "endpoint_name": "Printer 2", - "endpoint_url": "192.168.233.5:80" - }, - { - "type": "tcp", - "endpoint_name": "PoS Tablet", - "endpoint_url": "192.168.233.49:80" - } - ], - "storage": { - "provider": "github", - "access_token": "HIDDEN", - "repository_owner": "tobru", - "repository_name": "fwu-pos-statuspage", - "committer_name": "Checkup on PoS", - "committer_email": "pos@feuerwehrurdorf.ch", - "branch": "gh-pages", - "dir": "updates" - } -} diff --git a/contrib/healthchecks-cronjob.yaml b/contrib/healthchecks-cronjob.yaml new file mode 100644 index 0000000..f8763e6 --- /dev/null +++ b/contrib/healthchecks-cronjob.yaml @@ -0,0 +1,29 @@ +apiVersion: batch/v1beta1 +kind: CronJob +metadata: + name: healthchecks-io + namespace: hc +spec: + schedule: "*/1 * * * *" + concurrencyPolicy: Forbid + successfulJobsHistoryLimit: 1 + failedJobsHistoryLimit: 1 + jobTemplate: + spec: + template: + spec: + containers: + - name: pinghc + env: + - name: HCURL + valueFrom: + secretKeyRef: + name: healthchecks-io + key: HCURL + image: busybox + args: + - /bin/sh + - -c + - "date && echo $HCURL && /bin/wget -q -O - --no-check-certificate $HCURL" + restartPolicy: OnFailure + diff --git a/docker-compose.yml b/docker-compose.yml index e0faa71..5414f85 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -62,14 +62,6 @@ services: # networks: # localnet: # ipv4_address: 10.5.0.5 -# monitoring: -# build: ./monitoring -# command: checkup every 10m -# volumes: -# - ./checkup.json:/opt/checkup/checkup.json:ro -# networks: -# localnet: -# ipv4_address: 10.5.0.6 volumes: odoo-web-data: odoo-db-data: diff --git a/monitoring/Dockerfile b/monitoring/Dockerfile deleted file mode 100644 index 6ddf4c1..0000000 --- a/monitoring/Dockerfile +++ /dev/null @@ -1,7 +0,0 @@ -FROM golang:1.10-alpine - -RUN set -x; apk add --no-cache git build-base && \ - go get -v -u github.com/sourcegraph/checkup/cmd/checkup && \ - mkdir -p /opt/checkup - -WORKDIR /opt/checkup