add gatus
This commit is contained in:
parent
e4bfce1c60
commit
d9382c2373
7 changed files with 353 additions and 0 deletions
23
kubernetes/apps/observability/gatus/app/externalsecret.yaml
Normal file
23
kubernetes/apps/observability/gatus/app/externalsecret.yaml
Normal file
|
@ -0,0 +1,23 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://ks.hsn.dev/external-secrets.io/externalsecret_v1beta1.json
|
||||
apiVersion: external-secrets.io/v1beta1
|
||||
kind: ExternalSecret
|
||||
metadata:
|
||||
name: gatus
|
||||
spec:
|
||||
secretStoreRef:
|
||||
kind: ClusterSecretStore
|
||||
name: onepassword-connect
|
||||
target:
|
||||
name: gatus-secret
|
||||
template:
|
||||
engineVersion: v2
|
||||
data:
|
||||
CUSTOM_PUSHOVER_TOKEN: "{{ .gatus_token }}"
|
||||
CUSTOM_PUSHOVER_USER_KEY: "{{ .userkey_jahanson }}"
|
||||
DATABASE_URI: "postgresql://{{ .pg_username }}:{{ .pg_password }}@postgres-primary-real.database.svc:{{ .pg_port }}/{{ .pg_database }}"
|
||||
dataFrom:
|
||||
- extract:
|
||||
key: pushover
|
||||
- extract:
|
||||
key: gatus
|
131
kubernetes/apps/observability/gatus/app/helmrelease.yaml
Normal file
131
kubernetes/apps/observability/gatus/app/helmrelease.yaml
Normal file
|
@ -0,0 +1,131 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json
|
||||
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||
kind: HelmRelease
|
||||
metadata:
|
||||
name: gatus
|
||||
spec:
|
||||
interval: 30m
|
||||
chart:
|
||||
spec:
|
||||
chart: app-template
|
||||
version: 3.4.0
|
||||
sourceRef:
|
||||
kind: HelmRepository
|
||||
name: bjw-s
|
||||
namespace: flux-system
|
||||
install:
|
||||
remediation:
|
||||
retries: 3
|
||||
upgrade:
|
||||
cleanupOnFail: true
|
||||
remediation:
|
||||
strategy: rollback
|
||||
retries: 3
|
||||
values:
|
||||
controllers:
|
||||
gatus:
|
||||
annotations:
|
||||
reloader.stakater.com/auto: "true"
|
||||
initContainers:
|
||||
init-config:
|
||||
image:
|
||||
repository: ghcr.io/kiwigrid/k8s-sidecar
|
||||
tag: 1.27.6@sha256:db85bd5532530d288736b35e63baceacbf570bf863d85a0404b33c1e1631f63b
|
||||
env:
|
||||
FOLDER: /config
|
||||
LABEL: gatus.io/enabled
|
||||
NAMESPACE: ALL
|
||||
RESOURCE: both
|
||||
UNIQUE_FILENAMES: true
|
||||
METHOD: WATCH
|
||||
restartPolicy: Always
|
||||
resources: &resources
|
||||
requests:
|
||||
cpu: 10m
|
||||
limits:
|
||||
memory: 256Mi
|
||||
containers:
|
||||
app:
|
||||
image:
|
||||
repository: ghcr.io/twin/gatus
|
||||
tag: v5.12.1@sha256:3cc4e90534c05599f07fbdf15580401aa7771fac15f51d1dc8f7de265d70d12f
|
||||
env:
|
||||
TZ: America/Chicago
|
||||
GATUS_CONFIG_PATH: /config
|
||||
GATUS_DELAY_START_SECONDS: 5
|
||||
CUSTOM_WEB_PORT: &port 80
|
||||
envFrom:
|
||||
- secretRef:
|
||||
name: gatus-secret
|
||||
probes:
|
||||
liveness: &probes
|
||||
enabled: true
|
||||
custom: true
|
||||
spec:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: *port
|
||||
initialDelaySeconds: 0
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 1
|
||||
failureThreshold: 3
|
||||
readiness: *probes
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: true
|
||||
capabilities: { drop: ["ALL"] }
|
||||
resources: *resources
|
||||
pod:
|
||||
dnsConfig:
|
||||
options:
|
||||
- { name: ndots, value: "1" }
|
||||
securityContext:
|
||||
runAsUser: 568
|
||||
runAsGroup: 568
|
||||
runAsNonRoot: true
|
||||
fsGroup: 568
|
||||
fsGroupChangePolicy: OnRootMismatch
|
||||
service:
|
||||
app:
|
||||
controller: gatus
|
||||
ports:
|
||||
http:
|
||||
port: *port
|
||||
serviceMonitor:
|
||||
app:
|
||||
serviceName: gatus
|
||||
endpoints:
|
||||
- port: http
|
||||
scheme: http
|
||||
path: /metrics
|
||||
interval: 1m
|
||||
scrapeTimeout: 10s
|
||||
ingress:
|
||||
app:
|
||||
className: external-nginx
|
||||
annotations:
|
||||
external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
|
||||
external-dns.alpha.kubernetes.io/target: external.hsn.dev
|
||||
hosts:
|
||||
- host: &host status.hsn.dev
|
||||
paths:
|
||||
- path: /
|
||||
service:
|
||||
identifier: app
|
||||
port: http
|
||||
tls:
|
||||
- hosts: [*host]
|
||||
serviceAccount:
|
||||
create: true
|
||||
name: gatus
|
||||
persistence:
|
||||
config:
|
||||
type: emptyDir
|
||||
config-file:
|
||||
type: configMap
|
||||
name: gatus-configmap
|
||||
globalMounts:
|
||||
- path: /config/config.yaml
|
||||
subPath: config.yaml
|
||||
readOnly: true
|
14
kubernetes/apps/observability/gatus/app/kustomization.yaml
Normal file
14
kubernetes/apps/observability/gatus/app/kustomization.yaml
Normal file
|
@ -0,0 +1,14 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://json.schemastore.org/kustomization
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ./externalsecret.yaml
|
||||
- ./helmrelease.yaml
|
||||
- ./rbac.yaml
|
||||
configMapGenerator:
|
||||
- name: gatus-configmap
|
||||
files:
|
||||
- config.yaml=./resources/config.yml
|
||||
generatorOptions:
|
||||
disableNameSuffixHash: true
|
22
kubernetes/apps/observability/gatus/app/rbac.yaml
Normal file
22
kubernetes/apps/observability/gatus/app/rbac.yaml
Normal file
|
@ -0,0 +1,22 @@
|
|||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: gatus
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["configmaps", "secrets"]
|
||||
verbs: ["get", "watch", "list"]
|
||||
---
|
||||
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: observability
|
133
kubernetes/apps/observability/gatus/app/resources/config.yml
Normal file
133
kubernetes/apps/observability/gatus/app/resources/config.yml
Normal file
|
@ -0,0 +1,133 @@
|
|||
---
|
||||
# Note: Gatus vars should be escaped with $${VAR_NAME} to avoid interpolation by Flux
|
||||
web:
|
||||
port: $${CUSTOM_WEB_PORT}
|
||||
storage:
|
||||
type: postgres
|
||||
path: $${DATABASE_URI}
|
||||
caching: true
|
||||
metrics: true
|
||||
debug: false
|
||||
ui:
|
||||
title: Status | Gatus
|
||||
header: Status
|
||||
alerting:
|
||||
pushover:
|
||||
application-token: $${CUSTOM_PUSHOVER_TOKEN}
|
||||
user-key: $${CUSTOM_PUSHOVER_USER_KEY}
|
||||
default-alert:
|
||||
description: health-check failed
|
||||
send-on-resolved: true
|
||||
failure-threshold: 5
|
||||
success-threshold: 2
|
||||
connectivity:
|
||||
checker:
|
||||
target: 1.1.1.1:53
|
||||
interval: 1m
|
||||
endpoints:
|
||||
- name: status
|
||||
group: external
|
||||
url: https://status.hsn.dev
|
||||
interval: 1m
|
||||
client:
|
||||
dns-resolver: tcp://1.1.1.1:53
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
alerts:
|
||||
- type: pushover
|
||||
# - name: Umami
|
||||
# group: external
|
||||
# url: https://umi.hsn.dev/script.js
|
||||
# interval: 1m
|
||||
# client:
|
||||
# dns-resolver: tcp://1.1.1.1:53
|
||||
# conditions:
|
||||
# - "[STATUS] == 200"
|
||||
# alerts:
|
||||
# - type: pushover
|
||||
- name: Nextcloud External
|
||||
group: external
|
||||
url: https://nc.hsn.dev
|
||||
interval: 1m
|
||||
ui:
|
||||
hide-url: true
|
||||
hide-hostname: true
|
||||
client:
|
||||
dns-resolver: tcp://1.1.1.1:53
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
alerts:
|
||||
- type: pushover
|
||||
- name: flux-webhook
|
||||
group: external
|
||||
url: https://flux-receiver.hsn.dev
|
||||
interval: 1m
|
||||
client:
|
||||
dns-resolver: tcp://1.1.1.1:53
|
||||
conditions:
|
||||
- "[STATUS] == 404"
|
||||
alerts:
|
||||
- type: pushover
|
||||
- name: Elessar
|
||||
group: internal
|
||||
url: https://elessar.jahanson.tech
|
||||
interval: 1m
|
||||
client:
|
||||
dns-resolver: tcp://10.1.1.1:53
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
alerts:
|
||||
- type: pushover
|
||||
- name: Sting
|
||||
group: internal
|
||||
url: http://sting.jahanson.tech
|
||||
interval: 1m
|
||||
client:
|
||||
dns-resolver: tcp://10.1.1.1:53
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
alerts:
|
||||
- type: pushover
|
||||
# - name: Gandalf
|
||||
# group: internal
|
||||
# url: https://gandalf.jahanson.tech:8443
|
||||
# interval: 1m
|
||||
# client:
|
||||
# dns-resolver: tcp://10.1.1.1:53
|
||||
# conditions:
|
||||
# - "[STATUS] == 200"
|
||||
# alerts:
|
||||
# - type: pushover
|
||||
- name: Gollum
|
||||
group: internal
|
||||
url: http://gollum.jahanson.tech
|
||||
interval: 1m
|
||||
client:
|
||||
dns-resolver: tcp://10.1.1.1:53
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
alerts:
|
||||
- type: pushover
|
||||
- name: Nextcloud Internal
|
||||
group: internal
|
||||
url: https://nc.hsn.dev
|
||||
interval: 1m
|
||||
ui:
|
||||
hide-url: true
|
||||
hide-hostname: true
|
||||
client:
|
||||
dns-resolver: tcp://10.1.1.1:53
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
alerts:
|
||||
- type: pushover
|
||||
- name: Home Assistant
|
||||
group: internal
|
||||
url: https://hass.jahanson.tech
|
||||
interval: 1m
|
||||
client:
|
||||
dns-resolver: tcp://10.1.1.1:53
|
||||
conditions:
|
||||
- "[STATUS] == 200"
|
||||
alerts:
|
||||
- type: pushover
|
29
kubernetes/apps/observability/gatus/ks.yaml
Normal file
29
kubernetes/apps/observability/gatus/ks.yaml
Normal file
|
@ -0,0 +1,29 @@
|
|||
---
|
||||
# yaml-language-server: $schema=https://ks.hsn.dev/kustomize.toolkit.fluxcd.io/kustomization_v1.json
|
||||
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||
kind: Kustomization
|
||||
metadata:
|
||||
name: &app gatus
|
||||
namespace: flux-system
|
||||
spec:
|
||||
targetNamespace: observability
|
||||
commonMetadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: *app
|
||||
dependsOn:
|
||||
- name: crunchy-postgres-operator
|
||||
- name: external-secrets-stores
|
||||
path: ./kubernetes/apps/observability/gatus/app
|
||||
prune: true
|
||||
sourceRef:
|
||||
kind: GitRepository
|
||||
name: theshire
|
||||
wait: false
|
||||
interval: 30m
|
||||
retryInterval: 1m
|
||||
timeout: 5m
|
||||
postBuild:
|
||||
substitute:
|
||||
APP: *app
|
||||
DB_NAME: gatus
|
||||
DB_USER: gatus
|
|
@ -8,3 +8,4 @@ resources:
|
|||
# Flux-Kustomizations
|
||||
- ./kube-prometheus-stack/ks.yaml
|
||||
- ./prometheus-operator-crds/ks.yaml
|
||||
- ./gatus/ks.yaml
|
||||
|
|
Loading…
Reference in a new issue