Skip to content

Commit fe5f5c4

Browse files
committed
feat: migrate status host to public grafana stack
1 parent 02e63a3 commit fe5f5c4

7 files changed

Lines changed: 371 additions & 20 deletions

File tree

workloads/grafana/kustomization.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ apiVersion: kustomize.config.k8s.io/v1beta1
33
kind: Kustomization
44
resources:
55
- grafana.yaml
6+
- status-grafana.yaml
7+
- status-monitoring.yaml
8+
- status-datasource.yaml
9+
- status-dashboard.yaml
610
- onion-service.yaml
711
- tunnel-binding.yaml
812
generators:
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
---
2+
apiVersion: grafana.integreatly.org/v1beta1
3+
kind: GrafanaDashboard
4+
metadata:
5+
name: grafana-status-overview
6+
namespace: grafana
7+
annotations:
8+
argocd.argoproj.io/sync-wave: "1"
9+
spec:
10+
instanceSelector:
11+
matchLabels:
12+
dashboards: "grafana-status"
13+
json: |
14+
{
15+
"uid": "status-overview",
16+
"title": "Status Overview",
17+
"schemaVersion": 39,
18+
"version": 1,
19+
"editable": false,
20+
"refresh": "1m",
21+
"time": {
22+
"from": "now-7d",
23+
"to": "now"
24+
},
25+
"panels": [
26+
{
27+
"id": 1,
28+
"type": "bargauge",
29+
"title": "7 Day Uptime (%)",
30+
"gridPos": {
31+
"h": 10,
32+
"w": 24,
33+
"x": 0,
34+
"y": 0
35+
},
36+
"targets": [
37+
{
38+
"expr": "100 * avg_over_time(probe_success{job=~\".*status-endpoints.*\"}[7d])",
39+
"legendFormat": "{{instance}}",
40+
"refId": "A"
41+
}
42+
],
43+
"options": {
44+
"displayMode": "gradient",
45+
"orientation": "horizontal",
46+
"reduceOptions": {
47+
"calcs": [
48+
"lastNotNull"
49+
],
50+
"fields": "",
51+
"values": false
52+
},
53+
"showUnfilled": true
54+
},
55+
"fieldConfig": {
56+
"defaults": {
57+
"unit": "percent",
58+
"min": 0,
59+
"max": 100,
60+
"thresholds": {
61+
"mode": "absolute",
62+
"steps": [
63+
{
64+
"color": "red",
65+
"value": null
66+
},
67+
{
68+
"color": "yellow",
69+
"value": 99
70+
},
71+
{
72+
"color": "green",
73+
"value": 99.9
74+
}
75+
]
76+
}
77+
},
78+
"overrides": []
79+
}
80+
},
81+
{
82+
"id": 2,
83+
"type": "timeseries",
84+
"title": "Probe Success (Last 24h)",
85+
"gridPos": {
86+
"h": 10,
87+
"w": 24,
88+
"x": 0,
89+
"y": 10
90+
},
91+
"targets": [
92+
{
93+
"expr": "probe_success{job=~\".*status-endpoints.*\"}",
94+
"legendFormat": "{{instance}}",
95+
"refId": "A"
96+
}
97+
],
98+
"fieldConfig": {
99+
"defaults": {
100+
"min": 0,
101+
"max": 1,
102+
"unit": "none"
103+
},
104+
"overrides": []
105+
},
106+
"options": {
107+
"legend": {
108+
"displayMode": "table",
109+
"placement": "bottom"
110+
},
111+
"tooltip": {
112+
"mode": "multi"
113+
}
114+
}
115+
}
116+
]
117+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
apiVersion: grafana.integreatly.org/v1beta1
3+
kind: GrafanaDatasource
4+
metadata:
5+
name: grafana-status-prometheus
6+
namespace: grafana
7+
annotations:
8+
argocd.argoproj.io/sync-wave: "1"
9+
spec:
10+
instanceSelector:
11+
matchLabels:
12+
dashboards: "grafana-status"
13+
datasource:
14+
name: Prometheus
15+
type: prometheus
16+
access: proxy
17+
isDefault: true
18+
url: https://thanos-querier.openshift-monitoring.svc:9091
19+
jsonData:
20+
tlsSkipVerify: true
21+
timeInterval: 30s
22+
httpHeaderName1: Authorization
23+
secureJsonData:
24+
httpHeaderValue1: Bearer ${token}
25+
valuesFrom:
26+
- targetPath: "secureJsonData.httpHeaderValue1"
27+
valueFrom:
28+
secretKeyRef:
29+
name: grafana-status-metrics-reader-token
30+
key: token
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
---
2+
apiVersion: grafana.integreatly.org/v1beta1
3+
kind: Grafana
4+
metadata:
5+
name: grafana-status
6+
namespace: grafana
7+
labels:
8+
dashboards: "grafana-status"
9+
annotations:
10+
argocd.argoproj.io/sync-wave: "1"
11+
spec:
12+
config:
13+
log:
14+
mode: "console"
15+
deployment:
16+
spec:
17+
template:
18+
spec:
19+
containers:
20+
- name: grafana
21+
env:
22+
- name: GF_SERVER_ROOT_URL
23+
value: "https://status.makeitwork.cloud"
24+
- name: GF_AUTH_ANONYMOUS_ENABLED
25+
value: "true"
26+
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
27+
value: "Viewer"
28+
- name: GF_AUTH_DISABLE_LOGIN_FORM
29+
value: "true"
30+
- name: GF_USERS_ALLOW_SIGN_UP
31+
value: "false"
32+
- name: GF_USERS_HOME_PAGE
33+
value: "/d/status-overview/status-overview"
34+
- name: GF_EXPLORE_ENABLED
35+
value: "false"
36+
- name: GF_ALERTING_ENABLED
37+
value: "false"
38+
- name: GF_UNIFIED_ALERTING_ENABLED
39+
value: "false"
40+
persistentVolumeClaim:
41+
spec:
42+
accessModes:
43+
- ReadWriteOnce
44+
resources:
45+
requests:
46+
storage: 2Gi
47+
route:
48+
spec:
49+
host: status.makeitwork.cloud
50+
tls:
51+
termination: edge
52+
insecureEdgeTerminationPolicy: Redirect
53+
to:
54+
kind: Service
55+
name: grafana-status-service
56+
weight: 100
57+
---
58+
apiVersion: networking.cfargotunnel.com/v1alpha1
59+
kind: TunnelBinding
60+
metadata:
61+
name: grafana-status
62+
namespace: grafana
63+
annotations:
64+
argocd.argoproj.io/sync-wave: "1"
65+
subjects:
66+
- name: grafana-status
67+
spec:
68+
fqdn: status.makeitwork.cloud
69+
target: http://grafana-status-service.grafana.svc:3000
70+
tunnelRef:
71+
kind: ClusterTunnel
72+
name: cluster-apps
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: cluster-monitoring-config
6+
namespace: openshift-monitoring
7+
annotations:
8+
argocd.argoproj.io/sync-wave: "0"
9+
data:
10+
config.yaml: |
11+
enableUserWorkload: true
12+
---
13+
apiVersion: v1
14+
kind: ConfigMap
15+
metadata:
16+
name: blackbox-exporter-config
17+
namespace: grafana
18+
annotations:
19+
argocd.argoproj.io/sync-wave: "1"
20+
data:
21+
blackbox.yml: |
22+
modules:
23+
http_2xx:
24+
prober: http
25+
timeout: 10s
26+
http:
27+
method: GET
28+
preferred_ip_protocol: ip4
29+
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
30+
---
31+
apiVersion: apps/v1
32+
kind: Deployment
33+
metadata:
34+
name: blackbox-exporter
35+
namespace: grafana
36+
annotations:
37+
argocd.argoproj.io/sync-wave: "1"
38+
ignore-check.kube-linter.io/unset-memory-requirements: "No limits on single-node cluster"
39+
spec:
40+
replicas: 1
41+
selector:
42+
matchLabels:
43+
app: blackbox-exporter
44+
template:
45+
metadata:
46+
labels:
47+
app: blackbox-exporter
48+
spec:
49+
securityContext:
50+
runAsNonRoot: true
51+
seccompProfile:
52+
type: RuntimeDefault
53+
containers:
54+
- name: blackbox-exporter
55+
image: quay.io/prometheus/blackbox-exporter:v0.26.0
56+
args:
57+
- --config.file=/etc/blackbox/blackbox.yml
58+
ports:
59+
- containerPort: 9115
60+
name: http
61+
resources:
62+
requests:
63+
cpu: "50m"
64+
memory: "64Mi"
65+
securityContext:
66+
allowPrivilegeEscalation: false
67+
capabilities:
68+
drop:
69+
- ALL
70+
readOnlyRootFilesystem: true
71+
runAsNonRoot: true
72+
runAsUser: 65534
73+
volumeMounts:
74+
- name: config
75+
mountPath: /etc/blackbox
76+
volumes:
77+
- name: config
78+
configMap:
79+
name: blackbox-exporter-config
80+
---
81+
apiVersion: v1
82+
kind: Service
83+
metadata:
84+
name: blackbox-exporter
85+
namespace: grafana
86+
annotations:
87+
argocd.argoproj.io/sync-wave: "1"
88+
spec:
89+
selector:
90+
app: blackbox-exporter
91+
ports:
92+
- name: http
93+
port: 9115
94+
targetPort: http
95+
---
96+
apiVersion: monitoring.coreos.com/v1
97+
kind: Probe
98+
metadata:
99+
name: status-endpoints
100+
namespace: grafana
101+
annotations:
102+
argocd.argoproj.io/sync-wave: "1"
103+
spec:
104+
interval: 30s
105+
module: http_2xx
106+
prober:
107+
path: /probe
108+
url: blackbox-exporter.grafana.svc:9115
109+
targets:
110+
staticConfig:
111+
static:
112+
- https://argocd.makeitwork.cloud
113+
- https://grafana.makeitwork.cloud
114+
- https://ansible.makeitwork.cloud
115+
- https://status.makeitwork.cloud
116+
---
117+
apiVersion: v1
118+
kind: ServiceAccount
119+
metadata:
120+
name: grafana-status-metrics-reader
121+
namespace: grafana
122+
annotations:
123+
argocd.argoproj.io/sync-wave: "1"
124+
---
125+
apiVersion: v1
126+
kind: Secret
127+
metadata:
128+
name: grafana-status-metrics-reader-token
129+
namespace: grafana
130+
annotations:
131+
kubernetes.io/service-account.name: grafana-status-metrics-reader
132+
argocd.argoproj.io/sync-wave: "1"
133+
type: kubernetes.io/service-account-token
134+
---
135+
apiVersion: rbac.authorization.k8s.io/v1
136+
kind: ClusterRoleBinding
137+
metadata:
138+
name: grafana-status-metrics-reader
139+
annotations:
140+
argocd.argoproj.io/sync-wave: "1"
141+
roleRef:
142+
apiGroup: rbac.authorization.k8s.io
143+
kind: ClusterRole
144+
name: cluster-monitoring-view
145+
subjects:
146+
- kind: ServiceAccount
147+
name: grafana-status-metrics-reader
148+
namespace: grafana

workloads/uptime-kuma/kustomization.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ kind: Kustomization
44
resources:
55
- uptime-kuma.yaml
66
- onion-service.yaml
7-
- tunnel-binding.yaml
87
generators:
98
- ksops-uptime-kuma-secrets.yaml

0 commit comments

Comments
 (0)