Skip to content

Commit b63675c

Browse files
maroromanChad Roberts
authored andcommitted
Add some monitoring components forn deployer (#104)
1 parent 8c13be6 commit b63675c

6 files changed

Lines changed: 89 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
annotations:
5+
prometheus.io/scheme: http
6+
prometheus.io/scrape: 'true'
7+
labels:
8+
app: jupyterhub-db-probe
9+
name: jupyterhub-db-probe
10+
namespace: redhat-ods-applications
11+
spec:
12+
ports:
13+
- name: metrics
14+
port: 8080
15+
targetPort: metrics
16+
selector:
17+
deployment: jupyterhub-db-probe
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
annotations:
5+
labels:
6+
app: jupyterhub-db-probe
7+
name: jupyterhub-db-probe
8+
namespace: redhat-ods-applications
9+
spec:
10+
replicas: 1
11+
selector:
12+
matchLabels:
13+
deployment: jupyterhub-db-probe
14+
template:
15+
metadata:
16+
labels:
17+
deployment: jupyterhub-db-probe
18+
spec:
19+
containers:
20+
- env:
21+
- name: JUPYTERHUB_DB_USER
22+
value: jupyterhub
23+
- name: JUPYTERHUB_DB_PASSWORD
24+
valueFrom:
25+
secretKeyRef:
26+
name: jupyterhub-database-password
27+
key: POSTGRESQL_PASSWORD
28+
name: db-probe
29+
image: quay.io/modh/jupyterhub-db-probe:v0.2
30+
imagePullPolicy: Always
31+
ports:
32+
- containerPort: 8080
33+
name: metrics
34+
resources:
35+
limits:
36+
cpu: 300m
37+
memory: 50Mi
38+
requests:
39+
cpu: 300m
40+
memory: 50Mi

jupyterhub/jupyterhub/base/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ resources:
44
- jupyterhub-configmap.yaml
55
- jupyterhub-secret.yaml
66
- jupyterhub-db-pvc.yaml
7+
- jupyterhub-db-probe.yaml
8+
- jupyterhub-db-probe-svc.yaml
79
- jupyterhub-db-dc.yaml
810
- jupyterhub-db-service.yaml
911
- jupyterhub-img-imagestream.yaml
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: authorization.openshift.io/v1
2+
kind: RoleBinding
3+
metadata:
4+
name: cluster-monitor-rhods-reader
5+
namespace: redhat-ods-monitoring
6+
roleRef:
7+
name: cluster-reader
8+
subjects:
9+
- kind: ServiceAccount
10+
name: prometheus-k8s
11+
namespace: openshift-monitoring

monitoring/base/kustomization.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- rhods-rules.yaml
5+
- cluster-monitor-rbac.yaml

monitoring/base/rhods-rules.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: monitoring.coreos.com/v1
2+
kind: PrometheusRule
3+
metadata:
4+
labels:
5+
prometheus: k8s
6+
role: recording-rules
7+
app: rhods
8+
name: rhods-rules
9+
spec:
10+
groups:
11+
- name: rhods-usage.rules
12+
rules:
13+
- record: cluster:usage:consumption:rhods:cpu:seconds:rate5m
14+
expr: sum(rate(container_cpu_usage_seconds_total{container="",pod=~"jupyterhub-nb.*",namespace="redhat-ods-applications"}[5m]))

0 commit comments

Comments
 (0)