diff --git a/helm/jupyterhub-home-nfs/templates/deployment.yaml b/helm/jupyterhub-home-nfs/templates/deployment.yaml index 0d54440..d9e8781 100644 --- a/helm/jupyterhub-home-nfs/templates/deployment.yaml +++ b/helm/jupyterhub-home-nfs/templates/deployment.yaml @@ -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 @@ -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: diff --git a/helm/jupyterhub-home-nfs/values.yaml b/helm/jupyterhub-home-nfs/values.yaml index 499b6f4..6081ec2 100644 --- a/helm/jupyterhub-home-nfs/values.yaml +++ b/helm/jupyterhub-home-nfs/values.yaml @@ -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 @@ -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: