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

criu with k8s, how to? #1242

Closed
ashish-billore opened this issue Oct 23, 2020 · 10 comments
Closed

criu with k8s, how to? #1242

ashish-billore opened this issue Oct 23, 2020 · 10 comments

Comments

@ashish-billore
Copy link

ashish-billore commented Oct 23, 2020

First, this is not an issue, just a query, so please feel free to action it accordingly.

Context:
So far I am able to make criu checkpoint and restore work well for my application (user_sctp based sctp application) with runc directly (no management/orchestration layer above), all thanks to support from criu community and @adrianreber 👍

Now my goal is to somehow make this checkpoint and restore work with k8s pods.


Findings so far:

I see following pre-reqs for this:


While the community process is underway to have checkpoint restore support available in k8s (which will take sometime), I want to try it out in the meantime.

  • Has anyone tried making checkpoint/restore work with recent versions of k8s (v1.18 onwards)?
  • Do anyone has any recommended way to try it?

I could not find any recent working reference of criu + k8s.
If anyone knows, please share.

@adrianreber
Copy link
Member

I am not aware of any other public discussions around Kubernetes and container migration.

@ashish-billore
Copy link
Author

@adrianreber thanks for the response.

Sure, as I understand the above community activities will take a while to have checkpoint and restore available for pods with k8s, so I was looking for a working PoC possibly with workarounds, just to try it out with k8s pods.

Thanks!

@vutuong
Copy link

vutuong commented Oct 29, 2020

@ashish-billore You should check @schrej works here: kubernetes/kubernetes#3949. He has done a very wonderful job. He also published the document for testing pod migration in K8s ( in the thread) https://docs.google.com/document/u/1/d/1E5p_FOHDGAp5YEQ23dCi9I8wPnMzd4aOazxI4uO_AMo/edit
I also tested his work and it can work well. I hope that this very useful function will be worked or merged with K8S as soon as possible.

@ashish-billore
Copy link
Author

@vutuong Thanks for the useful info.
I was aware of @schrej work and the related discussion in the KEP (in my original query above), however, didn't try the patches yet.
I'll try these patches and wish this feature lands in k8s soon.
Thanks!

@vutuong
Copy link

vutuong commented Nov 27, 2020

I'll try these patches and wish this feature lands in k8s soon.
Thanks!
@ashish-billore I'm trying to gather information about why it needs to support podmigration in K8s as my research requirements. So could you please tell me your use-case or the reasons for that? Especially, the comparisons between podmigration and StatefulSets. Because we can also use StatefulSets to support for stateful applications without podmigration?

@adrianreber
Copy link
Member

@vutuong It seems you have another definition of a stateful application than I do. How do you define a stateful application?

@vutuong
Copy link

vutuong commented Nov 27, 2020

@vutuong How do you define a stateful application?
To answer your question, I think it will be more clear if we consider what the state is? To my best knowledge, the state that relates to the StatefulSet, for example in :https://www.youtube.com/watch?v=zj6r_EEhv6s&ab_channel=ThatDevOpsGuy, is something like a login session. For that, the states can be decoupled from the webserver process and store in other data storage (eg. Memcache, Redis, database). Then, the StatefulSet is introduced to deal with it.
So sometimes it makes me confuse. What is the difference between using Pod/container migration and StatefulSet since they seem both to try to prevent loss of application state?
Until now, I just found that, in comparison with StatefulSet, Pod/Container migration can speed up the initiation time for services that have a long startup time.
Any other reasons? I would be glad to hear your opinion? Thanks.

@adrianreber
Copy link
Member

When talking about stateful, from CRIU's point of view, it is about the actual state of all involved processes. Meaning everything the container processes have loaded in memory will still be loaded into memory after migration. Any kind of memory backed database for example. Or processes which need a long time to start and to initialize.

Not sure what a StatefulSet exactly is in Kubernetes, but it sounds like it is talking about state concerned to storage. If the container, even in a StatefulSet, is started again it still needs to load all the data from storage. CRIU enables you have a stateful migration including everything which the process has loaded in memory.

@github-actions
Copy link

github-actions bot commented Jan 5, 2021

A friendly reminder that this issue had no activity for 30 days.

@teo-tsou
Copy link

Hello after all this long time, is there any feature supporting SCTP socket maintenance after migration in CRIU? If not is there any way @ashish-billore to explain how did he manage to overcome it? Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants