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

Simplified integration with namespace local JupyterHub Helm charts #612

Conversation

consideRatio
Copy link
Collaborator

@consideRatio consideRatio commented Oct 7, 2022

Summary

Closes #473. The idea is to enable users installing both the dask-gateway chart and jupyterhub chart to not provide any api-token credential for dask-gateway/juyterhub to trust each other, but instead rely on a generated api-token persisted in a k8s Secret.

The implementation plan in #473 was the following:

Implementation idea

  1. Allow a k8s Secret name and key be configurable to mount the JupyterHub API token from a custom k8s Secret with a given key.
  2. Make the creation of the dask-gateway managed k8s Secret be conditional of not providing a custom k8s Secret name / key.
  3. Update the values schema with these settings

This PR follows that plan quite well, but provides a default for the k8s Secret name and Key config and relies on them by default unless the previously required apiToken is specified. This PR also updates the documentation under the topic of installing the dask-gateway helm chart and autenticating against a JupyterHub Helm chart installation.

Added chart config in values.yaml

gateway:
  auth:
    jupyterhub:
      # The JupyterHub Helm chart will automatically generate a token for a
      # registered service. If you don't specify an apiToken explicitly as
      # required in dask-gateway version <=2022.6.1, the dask-gateway Helm chart
      # will try to look for a token from a k8s Secret created by the JupyterHub
      # Helm chart in the same namespace. A failure to find this k8s Secret and
      # key will cause a MountFailure for when the api-dask-gateway pod is
      # starting.
      apiTokenFromSecretName: hub
      apiTokenFromSecretKey: hub.services.dask-gateway.apiToken

The schema file is also updated to reflect this new configuration.

Successfully tested

I've tested this on the hub.jupytearth.org deployment of a dask-gateway deployed next to a jupyterhub.

How dask/helm-chart's daskhub would adjust with this

Steps relating to generating and configuring an api token could be simplied. This would be an example of the configuration to have, without secret credentials involved.

jupyterhub:
  hub:
    services:
      dask-gateway:
        display: false

dask-gateway:
  gateway:
    auth:
      type: jupyterhub

@consideRatio consideRatio added enhancement New feature or request new codebase:helm-chart and removed enhancement New feature or request labels Oct 7, 2022
Copy link
Member

@TomAugspurger TomAugspurger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool @consideRatio!

One quick question: do you worry at all about upgrades to existing deployments? I suspect things will be just fine, since providing your own tokens continues to be an option.

@consideRatio
Copy link
Collaborator Author

consideRatio commented Oct 13, 2022

One quick question: do you worry at all about upgrades to existing deployments? I suspect things will be just fine, since providing your own tokens continues to be an option.

Exactly, previously everyone has been forced to provide a token - so they should all be fine as this will only impact people not providing a token.

Thank you for looking at this PR @TomAugspurger!!!

@TomAugspurger
Copy link
Member

Great, thanks. Feel free to merge whenever you're ready!

@consideRatio consideRatio merged commit 3914e0a into dask:main Oct 13, 2022
@consideRatio
Copy link
Collaborator Author

Thanks! Going for it!

consideRatio added a commit to consideRatio/pilot-hubs that referenced this pull request Oct 13, 2022
…hub chart

Relies on dask/dask-gateway#612 released in
2022.10.0 so we don't have to set this explicitly.
consideRatio added a commit to consideRatio/pilot-hubs that referenced this pull request Oct 13, 2022
…hub chart

Relies on dask/dask-gateway#612 released in
2022.10.0 so we don't have to set this explicitly.
yuvipanda pushed a commit to consideRatio/pilot-hubs that referenced this pull request Oct 14, 2022
…hub chart

Relies on dask/dask-gateway#612 released in
2022.10.0 so we don't have to set this explicitly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm chart: allow JUPYTERHUB_API_KEY to be mounted from specified k8s secret and key
2 participants