question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[kubernetes] Add ability to customize worker/scheduler pod names

See original GitHub issue

In dask-kubernetes, you can use the kubernetes.worker_name value to add each user’s name to the worker pod names. Is that customization something that can be done in Dask-gateway? I haven’t figured that out yet - if it’s not possible, I think that would be a useful feature to add. Would be nice for more quickly filtering pods and diagnosing any issues a particular user may be having. Happy to work on that but wanted to check first and see that I wasn’t just missing some existing functionality somewhere

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
cslovellcommented, Nov 18, 2021

Nevermind - seems the following works in the Helm chart values file:

dask-gateway: 
  gateway: 
    backend: ... [omitted for brevity]
    extraConfig:
      optionHandler: |
        from dask_gateway_server.options import Options, Integer, Float, String
        def cluster_options(user):  
            def option_handler(options):
                if ":" not in options.image:
                    raise ValueError("When specifying an image you must also provide a tag")
                extra_labels = {
                    "hub.jupyter.org/username": user.name
                }
                return {
                    "worker_cores": options.worker_cores,
                    "worker_memory": int(options.worker_memory * 2 ** 30),
                    "image": options.image,
                    "scheduler_extra_pod_labels": extra_labels,
                    "worker_extra_pod_labels": extra_labels,
                }
            return Options(
                Float("worker_cores", default=0.8, min=0.8, max=4.0, label="Worker Cores"),
                Float("worker_memory", default=3.3, min=1, max=8, label="Worker Memory (GiB)"),
                String("image", default="pangeo/base-notebook:2021.05.04", label="Image"),
                handler=option_handler,
            )
        c.Backend.cluster_options = cluster_options
0reactions
cslovellcommented, Nov 18, 2021

I know I’m late to the game - @droctothorpe I’m curious if you have a code snippet on how this is done. Also aiming to achieve some insight into per-user costs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Multiple Schedulers - Kubernetes
Add your scheduler name to the resourceNames of the rule applied for endpoints and leases resources, as in the following example:.
Read more >
Assigning Pods to Nodes - Kubernetes
Adding labels to nodes allows you to target Pods for scheduling on specific nodes or groups of nodes. You can use this functionality...
Read more >
Object Names and IDs | Kubernetes
Each object in your cluster has a Name that is unique for that type of resource. Every Kubernetes object also has a UID...
Read more >
Adding entries to Pod /etc/hosts with HostAliases - Kubernetes
You can add these custom entries with the HostAliases field in PodSpec. ... NAME READY STATUS RESTARTS AGE IP NODE hostaliases-pod 0/1 ...
Read more >
Kubernetes Scheduler
If you want to understand why Pods are placed onto a particular Node, or if you're planning to implement a custom scheduler yourself, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found