Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disk usage prometheus metrics to jupyterhub-home-nfs deployment #8

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading