Report this

What is the reason for this report?

Is it possible to enable swap for Kubernetes nodes?

Posted on June 18, 2019

There doesn’t seem to be an option to choose a distribution when setting up a node pool, which is understandable, as I’m sure Kubernetes has special requirements. But it seems that you can’t SSH into Kubernetes nodes, which again is understandable as that’s the point of Kubernetes and especially managed Kubernetes.

So I suspect the answer to my question is no. But it seems like such a simple little feature that could lead to more robust workloads and clusters.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi,

Any news on that matter? I’m having a similar problem where my GitLab runner is killed because of heavy needs for RAM by webpack minification during the build. Having a BIG node for running 4 project builds per day is not very cost-effective :D So I would love to see some optional swap on k8s nodes. I hope it is something easy to do and one day we will see it.

Best regards Piotr

Hi Tom,

Thanks for your question! At this time we do not enable swap on DOKS worker nodes. Can you explain a bit more about what types of workloads you would like to run that would utilize swap instead of more memory?

That’s good to know that it’s not officially supported yet, thank you.

However, it’s hard to take your question seriously. I can only take it to mean that your primary concern is for DO sales. Swap memory is such a fundamental concept in computing and has such a myriad of use cases that the only reason I can think that you would ask what workloads I might need it for is that DO would rather not lose the economic opportunity of customers solving their memory needs with profit making RAM. I’m sorry to be so cynical.

You didn’t need to frame your question like that. You could have simply said that DO appreciates the value of Swap but has yet to implement it in a reliable manner. I would have been satisfied with that answer.

But to spell it out: Swap is slow RAM, it replaces system crashes with infinitely preferable system slowness. It should not be a replacement for RAM but because of the profound difference between crashing and slowness I can not think of single situation where Swap should not be enabled by default on a system.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.