Chart missing jupyter- prefix?

Despite the definition of jupyterhub.fullname in _helpers-names.tpl, a templating of jupyterhub 1.2.0 chart does not seem to prefix resource names with jupyter-.

This seems odd; isn’t the point of jupyterhub.fullname.dash to default to jupyter- to avoid clashing names with other resources?

$ helm pull --untar --version 1.2.0 --repo https://jupyterhub.github.io/helm-chart/ jupyterhub
$ cd jupyterhub
$ helm template . | grep -A 10 'kind: Deployment'
kind: Deployment
metadata:
  name: hub
  labels:
    component: hub
    app: jupyterhub
    release: RELEASE-NAME
    chart: jupyterhub-1.2.0
    heritage: Helm
spec:
  replicas: 1
--
kind: Deployment
metadata:
  name: proxy
  labels:
    component: proxy
    app: jupyterhub
    release: RELEASE-NAME
    chart: jupyterhub-1.2.0
    heritage: Helm
spec:
  replicas: 1
--
kind: Deployment
metadata:
  name: user-scheduler
  labels:
    component: user-scheduler
    app: jupyterhub
    release: RELEASE-NAME
    chart: jupyterhub-1.2.0
    heritage: Helm
spec:
  replicas: 2

Notice in the above that all the resources (Deployments in this example) do not have a jupyter- prefix on their name.

My Go templating know-how is not strong enough to fully understand zero-to-jupyterhub-k8s/_helpers-names.tpl at 4d5c9ca123927930d33a4a501f612e81bab5f7e9 · jupyterhub/zero-to-jupyterhub-k8s · GitHub though, perhaps I am misinterpreting.

1 Like

Debugging with a ConfigMap

kind: ConfigMap
apiVersion: v1
metadata:
  name: findme
  labels:
    {{- include "jupyterhub.labels" . | nindent 4 }}
data:
  jupyterhub.fullname: {{ include "jupyterhub.fullname" . }}
  jupyterhub.fullname.dash: {{ include "jupyterhub.fullname.dash" . }}
  jupyterhub.hub.fullname: {{ include "jupyterhub.hub.fullname" . }}

Result:

$ helm template . | grep -A 10 findme
  name: findme
  labels:
    component: configmap-debug
    app: jupyterhub
    release: RELEASE-NAME
    chart: jupyterhub-1.2.0
    heritage: Helm
data:
  jupyterhub.fullname: 
  jupyterhub.fullname.dash: 
  jupyterhub.hub.fullname: hub

Helm: v3.7.2

The jupyter- prefix is only applied to user pods, not JupyterHub components, which are the hub, the proxy, etc.

You can set fullnameOverride in your config to define the prefix for jupyterhub components. It is an empty string by default, mostly for backward-compatibility reasons. There’s more info in the docs. The two main values to use are null to derive the value from the release and chart name, or an explicit string.

helm template --set fullnameOverride=null jupyterhub/jupyterhub --version=1.2.0 | grep -A 2 Deployment

gives

kind: Deployment
metadata:
  name: RELEASE-NAME-jupyterhub-hub
--
kind: Deployment
metadata:
  name: RELEASE-NAME-jupyterhub-proxy
--
kind: Deployment
metadata:
  name: RELEASE-NAME-jupyterhub-user-scheduler

or to set it to a specific value:

helm template --set fullnameOverride=prefix jupyterhub/jupyterhub --version=1.2.0 | grep -A 2 Deployment

for

kind: Deployment
metadata:
  name: prefix-hub
--
kind: Deployment
metadata:
  name: prefix-proxy
--
kind: Deployment
metadata:
  name: prefix-user-scheduler
2 Likes

Backwards compat considerations aside, this goes against a Helm best practice to provide some prefix by default. This is what all the Bitnami charts do, for instance. A resource that’s just named proxy is overly generic and has a high potential of conflicting with another app’s resource. Placing each single application in its own namespace is not a common enough approach to assume this is the base case.