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.

Default k8s resource requests/limits

See original GitHub issue

Use Case

When installing Dagster - via the Dagster Helm chart - on a resource constrained (or autoscaling) K8s cluster, having resource requests/limits set for all k8s containers is useful to:

(a) prevent accidental overcommit / OOM errors and (b) trigger (GKE) autoscaling rules.

Ideas of Implementation

  1. A default install (via the Helm chart; with no additional user config) should configure all k8s containers to have sane minimum resource limits - eg:

      resources:
        limits:
          cpu: 200m
          memory: 256Mi
        requests:
          cpu: 200m
          memory: 256Mi
    

    This should include all containers created by the initial install and those created via Pipeline Runs

  2. It should be possible to override these defaults on a case by case basis via any of the existing mechanisms (eg; extra Helm values config or tags = { 'dagster-k8s/config': {}} on any of the @solids

Additional Info

  • This handy bit of kubectl shows all the configured resource requests/limits for all pods in the dagster namespace
    kubectl --namespace dagster get pods \
    -o custom-columns=NAME:.metadata.name,IMAGE:.spec.containers[0].image,STATUS:.status.phase,\
    'CPU(request)':{.spec.containers[*].resources.requests.cpu},'CPU(limit)':{.spec.containers[*].resources.limits.cpu},\
    'MEMORY(request)':{.spec.containers[*].resources.requests.memory},'MEMORY(limit)':{.spec.containers[*].resources.limits.memory}
    
  • It may be possible to configure defaults by adding a LimitRange object to the namespace - I’d be happy to submit a PR with a “works on my GKE cluster” implementation if this seems like a sane approach

Message from the maintainers:

Excited about this feature? Give it a 👍. We factor engagement into prioritization.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mrdavidlaingcommented, Jan 30, 2021

@chenbobby Given the changes above; I think we should close this issue.

WDYT?

1reaction
mrdavidlaingcommented, Jan 6, 2021

@chenbobby Thanks for the thoughts - I’ll take a stab at a PR; but might only get to it this weekend.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Default Memory Requests and Limits for a ...
This page shows how to configure default memory requests and limits for a namespace. A Kubernetes cluster can be divided into namespaces.
Read more >
Understanding Kubernetes Limits and Requests - Sysdig
Pod effective request is 400 MiB of memory and 600 millicores of CPU. You need a node with enough free allocatable space to...
Read more >
Kubernetes requests vs limits: Why adding them to your Pods ...
The defaultRequest section sets up the default requests for a container in a pod. If you set these values in the limitRange, any...
Read more >
Setting the right requests and limits in Kubernetes - Learnk8s
The application can use more than 256MB, but Kubernetes guarantees a minimum of 256MB to the container. On the other hand, limits define...
Read more >
What is the default memory allocated for a pod - Stack Overflow
Kubernetes doesn't provide default resource limits out-of-the-box. This means that unless ...
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