Rename example directory to examples

This commit is contained in:
TwinProduction
2021-07-18 20:52:42 -04:00
parent bd3c01a4f4
commit 6d82a54518
19 changed files with 3 additions and 3 deletions

View File

@ -0,0 +1,16 @@
metrics: true
services:
- name: TwiNNatioN
url: https://twinnation.org/health
interval: 30s
conditions:
- "[STATUS] == 200"
- name: GitHub
url: https://api.github.com/healthz
interval: 5m
conditions:
- "[STATUS] == 200"
- name: Example
url: https://example.com/
conditions:
- "[STATUS] == 200"

View File

@ -0,0 +1,43 @@
version: '3.7'
services:
gatus:
container_name: gatus
image: twinproduction/gatus
restart: always
ports:
- 8080:8080
volumes:
- ./config.yaml:/config/config.yaml
networks:
- metrics
prometheus:
container_name: prometheus
image: prom/prometheus:v2.14.0
restart: always
command: --config.file=/etc/prometheus/prometheus.yml
ports:
- 9090:9090
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
- metrics
grafana:
container_name: grafana
image: grafana/grafana:6.4.4
restart: always
environment:
GF_SECURITY_ADMIN_PASSWORD: secret
ports:
- 3000:3000
volumes:
- ./grafana/grafana.ini/:/etc/grafana/grafana.ini:ro
- ./grafana/provisioning/:/etc/grafana/provisioning/:ro
networks:
- metrics
networks:
metrics:
driver: bridge

View File

@ -0,0 +1,85 @@
[paths]
[server]
[database]
[session]
[dataproxy]
[analytics]
reporting_enabled = false
[security]
[snapshots]
[dashboards]
[users]
allow_sign_up = false
default_theme = light
[auth]
[auth.anonymous]
enabled = true
org_name = Main Org.
org_role = Admin
[auth.github]
[auth.google]
[auth.generic_oauth]
[auth.grafana_com]
[auth.proxy]
[auth.basic]
[auth.ldap]
[smtp]
[emails]
[log]
mode = console
[log.console]
[log.file]
[log.syslog]
[alerting]
[explore]
[metrics]
enabled = true
[metrics.graphite]
[tracing.jaeger]
[grafana_com]
[external_image_storage]
[external_image_storage.s3]
[external_image_storage.webdav]
[external_image_storage.gcs]
[external_image_storage.azure_blob]
[external_image_storage.local]
[rendering]
[enterprise]

View File

@ -0,0 +1,11 @@
apiVersion: 1
providers:
- name: 'Prometheus'
orgId: 1
folder: ''
type: file
disableDeletion: false
editable: true
options:
path: /etc/grafana/provisioning/dashboards

View File

@ -0,0 +1,300 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": 2,
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 14,
"w": 12,
"x": 0,
"y": 0
},
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(gatus_tasks[30s])) by (service)",
"interval": "30s",
"legendFormat": "{{service}}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "All tasks executed over time",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 0
},
"id": 3,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(gatus_tasks{success=\"false\"}[30s])) by (service)",
"interval": "30s",
"legendFormat": "{{service}}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Unsuccessful tasks",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": null,
"fill": 1,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 12,
"x": 12,
"y": 7
},
"id": 5,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"dataLinks": []
},
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "sum(rate(gatus_tasks{success=\"true\"}[30s])) by (service)",
"instant": false,
"interval": "30s",
"legendFormat": "{{service}}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Successful tasks",
"tooltip": {
"shared": true,
"sort": 0,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"refresh": "10s",
"schemaVersion": 20,
"style": "dark",
"tags": [],
"templating": {
"list": []
},
"time": {
"from": "now-30m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Gatus",
"uid": "KPI7Qj1Wk",
"version": 3
}

View File

@ -0,0 +1,10 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
version: 1
editable: false

View File

@ -0,0 +1,6 @@
scrape_configs:
- job_name: gatus
scrape_interval: 10s
static_configs:
- targets:
- gatus:8080

View File

@ -0,0 +1,16 @@
alerting:
mattermost:
webhook-url: "http://mattermost:8065/hooks/tokengoeshere"
insecure: true
services:
- name: example
url: http://example.org
interval: 1m
alerts:
- type: mattermost
enabled: true
description: "healthcheck failed 3 times in a row"
send-on-resolved: true
conditions:
- "[STATUS] == 200"

View File

@ -0,0 +1,24 @@
version: "3.8"
services:
gatus:
container_name: gatus
image: twinproduction/gatus:latest
ports:
- 8080:8080
volumes:
- ./config.yaml:/config/config.yaml
networks:
- default
mattermost:
container_name: mattermost
image: mattermost/mattermost-preview:5.26.0
ports:
- 8065:8065
networks:
- default
networks:
default:
driver: bridge

View File

@ -0,0 +1,42 @@
storage:
type: sqlite
file: /data/data.db
services:
- name: back-end
group: core
url: "https://example.org/"
interval: 5m
conditions:
- "[STATUS] == 200"
- "[CERTIFICATE_EXPIRATION] > 48h"
- name: monitoring
group: internal
url: "https://example.org/"
interval: 5m
conditions:
- "[STATUS] == 200"
- name: nas
group: internal
url: "https://example.org/"
interval: 5m
conditions:
- "[STATUS] == 200"
- name: example-dns-query
url: "8.8.8.8" # Address of the DNS server to use
interval: 5m
dns:
query-name: "example.com"
query-type: "A"
conditions:
- "[BODY] == 93.184.216.34"
- "[DNS_RCODE] == NOERROR"
- name: icmp-ping
url: "icmp://example.org"
interval: 1m
conditions:
- "[CONNECTED] == true"

View File

@ -0,0 +1,9 @@
version: "3.8"
services:
gatus:
image: twinproduction/gatus:latest
ports:
- 8080:8080
volumes:
- ./config.yaml:/config/config.yaml
- ./data:/data/

View File

@ -0,0 +1,6 @@
services:
- name: example
url: http://example.org
interval: 30s
conditions:
- "[STATUS] == 200"

View File

@ -0,0 +1,8 @@
version: "3.8"
services:
gatus:
image: twinproduction/gatus:latest
ports:
- 8080:8080
volumes:
- ./config.yaml:/config/config.yaml

View File

@ -0,0 +1,109 @@
apiVersion: v1
data:
config.yaml: |
kubernetes:
cluster-mode: "in"
auto-discover: true
excluded-service-suffixes:
- canary
service-template:
interval: 30s
conditions:
- "[STATUS] == 200"
namespaces:
- name: default
hostname-suffix: ".default.svc.cluster.local"
target-path: "/health"
excluded-services:
- gatus
kind: ConfigMap
metadata:
name: gatus
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: gatus
rules:
- apiGroups:
- ""
resources:
- services
verbs:
- list
- get
---
apiVersion: v1
automountServiceAccountToken: true
kind: ServiceAccount
metadata:
name: gatus
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: gatus
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: gatus
subjects:
- kind: ServiceAccount
name: gatus
namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gatus
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
k8s-app: gatus
template:
metadata:
labels:
k8s-app: gatus
name: gatus
namespace: kube-system
spec:
containers:
- image: twinproduction/gatus
imagePullPolicy: IfNotPresent
name: gatus
ports:
- containerPort: 8080
name: http
protocol: TCP
resources:
limits:
cpu: 250m
memory: 100M
requests:
cpu: 50m
memory: 30M
volumeMounts:
- mountPath: /config
name: gatus-config
volumes:
- configMap:
name: gatus
name: gatus-config
---
apiVersion: v1
kind: Service
metadata:
name: gatus
namespace: kube-system
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
k8s-app: gatus

View File

@ -0,0 +1,87 @@
apiVersion: v1
data:
config.yaml: |
metrics: true
services:
- name: TwiNNatioN
url: https://twinnation.org/health
interval: 1m
conditions:
- "[STATUS] == 200"
- name: GitHub
url: https://api.github.com/healthz
interval: 5m
conditions:
- "[STATUS] == 200"
- name: cat-fact
url: "https://cat-fact.herokuapp.com/facts/random"
interval: 5m
conditions:
- "[STATUS] == 200"
- "[BODY].deleted == false"
- "len([BODY].text) > 0"
- "[BODY].text == pat(*cat*)"
- "[STATUS] == pat(2*)"
- "[CONNECTED] == true"
- name: Example
url: https://example.com/
conditions:
- "[STATUS] == 200"
kind: ConfigMap
metadata:
name: gatus
namespace: kube-system
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gatus
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
k8s-app: gatus
template:
metadata:
labels:
k8s-app: gatus
name: gatus
namespace: kube-system
spec:
containers:
- image: twinproduction/gatus
imagePullPolicy: IfNotPresent
name: gatus
ports:
- containerPort: 8080
name: http
protocol: TCP
resources:
limits:
cpu: 250m
memory: 100M
requests:
cpu: 50m
memory: 30M
volumeMounts:
- mountPath: /config
name: gatus-config
volumes:
- configMap:
name: gatus
name: gatus-config
---
apiVersion: v1
kind: Service
metadata:
name: gatus
namespace: kube-system
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
selector:
k8s-app: gatus

View File

@ -0,0 +1,2 @@
FROM twinproduction/gatus
ADD config.yaml ./config/config.yaml

View File

@ -0,0 +1,6 @@
services:
- name: example
url: http://example.org
interval: 30s
conditions:
- "[STATUS] == 200"