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

lifecycle_hooks can not be overridden in "kubespawner_override" #1242

Open
mhuttner opened this issue Apr 17, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@mhuttner
Copy link
Contributor

commented Apr 17, 2019

singleuser:
  image:
    name: jupyter/minimal-notebook
    tag: 7d427e7a4dde
  profileList:
    - display_name: Minimal Python Environment
      description: "Only the basic notebook"
      default: true
    - display_name: Other Environment
      description: ""
      kubespawner_override:
        image:  jupyter/r-notebook:latest
        lifecycleHooks:
          postStart:
           exec:
             command: ["/bin/sh", "-c", "echo Hello from overridden handler > $HOME/message"]
  lifecycleHooks:
    postStart:
     exec:
       command: ["/bin/sh", "-c", "echo Hello from the postStart handler > $HOME/message"]
  storage:
    capacity: 5Gi
    dynamic:
      storageClass: nfs-client
  memory:
    limit: 8G
    guarantee: 1G
  cpu:
    limit: 4
    guarantee: .5

A configuration like this will always call the default lifecycle hook instead of the one in the profile.

@consideRatio

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

Ah... but if you do...

  profileList:
    - display_name: Minimal Python Environment
      description: "Only the basic notebook"
      default: true
    - display_name: Other Environment
      description: ""
      kubespawner_override:
        image:  jupyter/r-notebook:latest
        lifecycle_hooks:
          postStart:
            exec:
              command: ["/bin/sh", "-c", "echo Hello from overridden handler > $HOME/message"]
  lifecycleHooks:
    postStart:
      exec:
        command: ["/bin/sh", "-c", "echo Hello from the postStart handler > $HOME/message"]

Yikes... Ready for a dirty reason why this is the case?

  1. The Z2JH Helm chart syntax for its values (lifecycleHooks)
  2. kubespawner's configuration options (lifecycle_hooks)
  3. Kubernetes pod specifications (postStart).

When you are writing things within kubespawner_override you are writing raw configuration for kubespawner, and must use the snake-case version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.