feat: route observability through one tailscale endpoint
This commit is contained in:
@@ -225,14 +225,14 @@ Flux deploys a lightweight observability stack in the `observability` namespace:
|
|||||||
|
|
||||||
Grafana content is managed as code via ConfigMaps in `infrastructure/addons/observability-content/` (Flux), migrated from `ansible/roles/observability-content/`.
|
Grafana content is managed as code via ConfigMaps in `infrastructure/addons/observability-content/` (Flux), migrated from `ansible/roles/observability-content/`.
|
||||||
|
|
||||||
Grafana and Prometheus are exposed via Tailscale (`loadBalancerClass: tailscale`) when the Tailscale Kubernetes Operator is healthy.
|
Grafana and Prometheus are exposed through a single Tailscale front door backed by Traefik when the Tailscale Kubernetes Operator is healthy.
|
||||||
|
|
||||||
### Access Grafana and Prometheus
|
### Access Grafana and Prometheus
|
||||||
|
|
||||||
Preferred (when Tailscale Operator is healthy):
|
Preferred (when Tailscale Operator is healthy):
|
||||||
|
|
||||||
- Grafana: `http://grafana` (or `http://grafana.<your-tailnet>`)
|
- Grafana: `http://observability/grafana/` (or `http://observability.<your-tailnet>/grafana/`)
|
||||||
- Prometheus: `http://prometheus` (or `http://prometheus.<your-tailnet>`)
|
- Prometheus: `http://observability/prometheus/` (or `http://observability.<your-tailnet>/prometheus/`)
|
||||||
|
|
||||||
Fallback (port-forward from a tailnet-connected machine):
|
Fallback (port-forward from a tailnet-connected machine):
|
||||||
|
|
||||||
|
|||||||
17
infrastructure/addons/observability/grafana-ingress.yaml
Normal file
17
infrastructure/addons/observability/grafana-ingress.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: grafana
|
||||||
|
namespace: observability
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- http:
|
||||||
|
paths:
|
||||||
|
- path: /grafana
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: observability-kube-prometheus-stack-grafana
|
||||||
|
port:
|
||||||
|
number: 80
|
||||||
@@ -24,16 +24,16 @@ spec:
|
|||||||
values:
|
values:
|
||||||
grafana:
|
grafana:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
grafana.ini:
|
||||||
|
server:
|
||||||
|
root_url: http://observability/grafana/
|
||||||
|
serve_from_sub_path: true
|
||||||
persistence:
|
persistence:
|
||||||
enabled: true
|
enabled: true
|
||||||
storageClassName: local-path
|
storageClassName: local-path
|
||||||
size: 5Gi
|
size: 5Gi
|
||||||
service:
|
service:
|
||||||
type: LoadBalancer
|
type: ClusterIP
|
||||||
loadBalancerClass: tailscale
|
|
||||||
annotations:
|
|
||||||
tailscale.com/hostname: grafana
|
|
||||||
tailscale.com/proxy-class: infra-stable
|
|
||||||
sidecar:
|
sidecar:
|
||||||
datasources:
|
datasources:
|
||||||
enabled: true
|
enabled: true
|
||||||
@@ -45,12 +45,10 @@ spec:
|
|||||||
searchNamespace: observability
|
searchNamespace: observability
|
||||||
prometheus:
|
prometheus:
|
||||||
service:
|
service:
|
||||||
type: LoadBalancer
|
type: ClusterIP
|
||||||
loadBalancerClass: tailscale
|
|
||||||
annotations:
|
|
||||||
tailscale.com/hostname: prometheus
|
|
||||||
tailscale.com/proxy-class: infra-stable
|
|
||||||
prometheusSpec:
|
prometheusSpec:
|
||||||
|
externalUrl: http://observability/prometheus/
|
||||||
|
routePrefix: /prometheus/
|
||||||
retention: 7d
|
retention: 7d
|
||||||
storageSpec:
|
storageSpec:
|
||||||
volumeClaimTemplate:
|
volumeClaimTemplate:
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- namespace.yaml
|
- namespace.yaml
|
||||||
|
- traefik-tailscale-service.yaml
|
||||||
|
- grafana-ingress.yaml
|
||||||
|
- prometheus-ingress.yaml
|
||||||
- helmrepository-prometheus-community.yaml
|
- helmrepository-prometheus-community.yaml
|
||||||
- helmrepository-grafana.yaml
|
- helmrepository-grafana.yaml
|
||||||
- helmrelease-kube-prometheus-stack.yaml
|
- helmrelease-kube-prometheus-stack.yaml
|
||||||
|
|||||||
17
infrastructure/addons/observability/prometheus-ingress.yaml
Normal file
17
infrastructure/addons/observability/prometheus-ingress.yaml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: prometheus
|
||||||
|
namespace: observability
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- http:
|
||||||
|
paths:
|
||||||
|
- path: /prometheus
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: observability-kube-prometh-prometheus
|
||||||
|
port:
|
||||||
|
number: 9090
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: traefik-tailscale
|
||||||
|
namespace: kube-system
|
||||||
|
annotations:
|
||||||
|
tailscale.com/hostname: observability
|
||||||
|
tailscale.com/proxy-class: infra-stable
|
||||||
|
spec:
|
||||||
|
type: LoadBalancer
|
||||||
|
loadBalancerClass: tailscale
|
||||||
|
selector:
|
||||||
|
app.kubernetes.io/instance: traefik-kube-system
|
||||||
|
app.kubernetes.io/name: traefik
|
||||||
|
ports:
|
||||||
|
- name: web
|
||||||
|
port: 80
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: web
|
||||||
|
- name: websecure
|
||||||
|
port: 443
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: websecure
|
||||||
Reference in New Issue
Block a user