Skip to content

Commit

Permalink
Merge pull request #8 from 2i2c-org/disk-usage-prometheus-metrics
Browse files Browse the repository at this point in the history
Add disk usage prometheus metrics to jupyterhub-home-nfs deployment
  • Loading branch information
sunu authored Nov 27, 2024
2 parents 3df76d1 + 79b2663 commit 75502f2
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
27 changes: 27 additions & 0 deletions helm/jupyterhub-home-nfs/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ spec:
metadata:
labels:
app: nfs-server
# The component label is used by the shared volume free space panel
# in jupyterhub/grafana-dashboards
# https://github.com/jupyterhub/grafana-dashboards/blob/18ba92d98cd297951673850a4c92507479ec4ca2/dashboards/jupyterhub.jsonnet#L322
component: shared-volume-metrics
annotations:
{{- if .Values.prometheusExporter.enabled }}
prometheus.io/scrape: "true"
prometheus.io/port: "9100"
{{- end }}
spec:
containers:
- name: nfs-server
Expand All @@ -35,6 +44,24 @@ spec:
volumeMounts:
- name: home-directories
mountPath: /export
{{- if .Values.prometheusExporter.enabled }}
- name: metrics-exporter
image: "{{ .Values.prometheusExporter.image.repository }}:{{ .Values.prometheusExporter.image.tag }}"
args:
# Disable default collectors; we only want filesystem metrics
- --collector.disable-defaults
- --collector.filesystem
# Exclude some patterns of mount points to avoid collecting unnecessary metrics
- --collector.filesystem.mount-points-exclude=^/(dev|proc|sys|etc|var/run/.+|var/lib/docker/.+|var/lib/kubelet/.+)($|/)
ports:
- name: metrics
containerPort: 9100
volumeMounts:
- name: home-directories
# Mounting under /shared-volume to match path in dashboard definition in jupyterhub/grafana-dashboards
mountPath: /shared-volume
readOnly: true
{{- end }}
volumes:
- name: home-directories
persistentVolumeClaim:
Expand Down
19 changes: 19 additions & 0 deletions helm/jupyterhub-home-nfs/values.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# NFS Ganesha configuration
# NFS Ganesha is the user space NFS server that we use to serve the home directories

nfsServer:
image:
repository: ghcr.io/2i2c-org/nfs-ganesha
tag: 0.0.6

# Quota enforcer configuration
# This container enforces the quota on the home directories

quotaEnforcer:
image:
repository: ghcr.io/2i2c-org/get-quota-your-home
Expand All @@ -11,7 +17,20 @@ quotaEnforcer:
# quota in GB
hardQuota: "10"

# Prometheus exporter configuration
# We export disk usage metrics using the Prometheus node exporter

prometheusExporter:
enabled: true
image:
repository: quay.io/prometheus/node-exporter
tag: v1.8.2

# Persistent volume configuration

persistentVolume:
# The size should match the pre-provisioned disk size
# The pre-provisioned disk ID is specified below in the cloud provider specific configuration
size: 10Gi
storageClass: ""
accessModes:
Expand Down

0 comments on commit 75502f2

Please sign in to comment.