Files
kubernetes/victoria-metrics/ingress.yaml
Dustin C. Hatch 8f088fb6ae v-m: Deploy (clustered) Victoria Metrics
Since *mtrcs0.pyrocufflink.blue* (the Metrics Pi) seems to be dying,
I decided to move monitoring and alerting into Kubernetes.

I was originally planning to have a single, dedicated virtual machine
for Victoria Metrics and Grafana, similar to how the Metrics Pi was set
up, but running Fedora CoreOS instead of a custom Buildroot-based OS.
While I was working on the Ignition configuration for the VM, it
occurred to me that monitoring would be interrupted frequently, since
FCOS updates weekly and all updates require a reboot.  I would rather
not have that many gaps in the data.  Ultimately I decided that
deploying a cluster with Kubernetes would probably be more robust and
reliable, as updates can be performed without any downtime at all.

I chose not to use the Victoria Metrics Operator, but rather handle
the resource definitions myself.  Victoria Metrics components are not
particularly difficult to deploy, so the overhead of running the
operator and using its custom resources would not be worth the minor
convenience it provides.
2024-01-01 17:48:10 -06:00

71 lines
2.1 KiB
YAML

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: victoria-metrics
labels:
app.kubernetes.io/name: victoria-metrics
app.kubernetes.io/component: victoria-metrics
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 40m
nginx.ingress.kubernetes.io/auth-method: GET
nginx.ingress.kubernetes.io/auth-url: http://authelia.authelia.svc.cluster.local:9091/api/verify
nginx.ingress.kubernetes.io/auth-signin: https://auth.pyrocufflink.blue/?rm=$request_method
nginx.ingress.kubernetes.io/auth-snippet: |
proxy_set_header X-Forwarded-Method $request_method;
spec:
rules:
- host: metrics.pyrocufflink.blue
http:
paths:
- path: /insert
pathType: Prefix
backend:
service:
name: vminsert
port:
name: vminsert
- path: /select
pathType: Prefix
backend:
service:
name: vmselect
port:
name: vmselect
- path: /vmalert
pathType: Prefix
backend:
service:
name: vmalert
port:
name: vmalert
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: alertmanager
labels:
app.kubernetes.io/name: alertmanager
app.kubernetes.io/component: alertmanager
annotations:
nginx.ingress.kubernetes.io/use-regex: 'true'
nginx.ingress.kubernetes.io/rewrite-target: /$2
nginx.ingress.kubernetes.io/proxy-body-size: 40m
nginx.ingress.kubernetes.io/auth-method: GET
nginx.ingress.kubernetes.io/auth-url: http://authelia.authelia.svc.cluster.local:9091/api/verify
nginx.ingress.kubernetes.io/auth-signin: https://auth.pyrocufflink.blue/?rm=$request_method
nginx.ingress.kubernetes.io/auth-snippet: |
proxy_set_header X-Forwarded-Method $request_method;
spec:
rules:
- host: metrics.pyrocufflink.blue
http:
paths:
- path: /alertmanager(/|$)(.*)
pathType: ImplementationSpecific
backend:
service:
name: alertmanager
port:
name: alertmanager