schrej / podmigration-operator

Part of a PoC of Pod migration in Kubernetes
Apache License 2.0
25 stars 4 forks source link

Guide #1

Closed mind-mind closed 3 years ago

mind-mind commented 3 years ago

I'm very interested in your thesis and I want to use it, but there is no guide, so it hard to try to make it work. Can you please give me a guide? Or what I should read to make this code work on migration.

Also, I already install K8s using CRI-O but have no idea what to do next. I think if you use CRIU, it has to use Podman container right since docker cannot use with CRIU?

Thank you so much.

schrej commented 3 years ago

Hey, glad to hear that! I've written a somewhat rough guide for it here. Not sure if it's still 100% accurate, so if you have any issues, please let me know and I'll try to help you. You can also reach me on k8s slack (also @schrej). You should probably build the binaries yourself, I'm pretty sure the ones available for download are outdated.

Edit: @vutuong has written a guide as well. I haven't tested it, but it looks good after a brief look: https://github.com/kubernetes/kubernetes/issues/3949#issuecomment-749936235 Again, I recommend building your own binaries from my fork at https://github.com/schrej/kubernetes

The thesis is available on ResearchGate (in case someone else finds this issue).

mind-mind commented 3 years ago

Okay. Since one part of my thesis has to use pod migrating K8s, I'II try to use this and ask you a question. Thank you so much.

mind-mind commented 3 years ago

Hi again, I follow this source

https://github.com/SSU-DCN/podmigration-operator/blob/main/init-cluster-containerd-CRIU.md

I got the problem while trying to install contained. Any idea?

Screen Shot 2021-05-22 at 8 41 55 PM
mind-mind commented 3 years ago

I also follow this step

image

But I got

image

I'm curious that when directory /var/lib/kubelet/migration/ was create?

Thank you for your answer in advance.

vutuong commented 3 years ago

Hi @mind-mind, I guess that you are using go-version 1.16.3 (or higher). I found that there is a problem with golang new version (https://blog.golang.org/go116-module-changes). I fixed it with this command:

$ cd containerd-cri/
$ go env -w GO111MODULE=auto

After that, you can continue with:

$ go get github.com/containerd/cri/cmd/containerd
$ make
...

The contained binaries should be found at _output/ directory. I also wrote in the document that there are two ways to get the containerd binaries. If you still can not build the containerd birary from @schrej Jakob source code, you can ask @schrej to download the binaries directly from his site:

$ wget https://k8s-pod-migration.obs.eu-de.otc.t-systems.com/v2/containerd
vutuong commented 3 years ago

I also follow this step

image

But I got

image

I'm curious that when directory /var/lib/kubelet/migration/ was create?

Thank you for your answer in advance.

Yes, sorry. This is my mistake. You should create the /var/lib/kubelet/migration/ directory at every node in the cluster first before doing step 9 with:

$ sudo mkdir /var/lib/kubelet/migration/
$ sudo chmod 777 /var/lib/kubelet/migration
mind-mind commented 3 years ago

Thank you @vutuong

I already did the setup and in this source: https://github.com/SSU-DCN/podmigration-operator/blob/main/init-cluster-containerd-CRIU.md

image

and follow this video https://www.youtube.com/watch?v=M4Ik7aUKhas

I use kubectl migrate

But I got this. Seems like no command migrate. What should I do?

mind-mind commented 3 years ago
image image image

I already create a migration directory in every node as you recommend.

vutuong commented 3 years ago

Thank you @vutuong

I already did the setup and in this source: https://github.com/SSU-DCN/podmigration-operator/blob/main/init-cluster-containerd-CRIU.md

image

and follow this video https://www.youtube.com/watch?v=M4Ik7aUKhas

I use kubectl migrate

But I got this. Seems like no command migrate. What should I do?

Hi, since as you can see in my guide (https://github.com/SSU-DCN/podmigration-operator), you should follow the How to run part ( except run the GUI) to make something like the demo video:

mind-mind commented 3 years ago

Thank you. Yeah, I know that K8s doesn't have command migrate by default and you wrote the kubectl plugin. I have to set up this on every node right?

vutuong commented 3 years ago

Thank you. Yeah, I know that K8s doesn't have command migrate by default and you wrote the kubectl plugin. I have to set up this on every node right?

No, you don't have to. Kubectl is used at the master node. So you just only have to set up these commands in the master node.

mind-mind commented 3 years ago

@vutuong Thank you though, but I got the problem when trying "make run"

image
vutuong commented 3 years ago

@vutuong Thank you thought, but I got the problem when trying "make run"

<img alt="image" width="839" src="https://user-images.githubusercontent.com/68138683/119264841-ee639600-bc0e-11eb-9578-ad56efd0f6a9.png"

@vutuong Thank you thought, but I got the problem when trying "make run"

image

Maybe, there is a conflict with the go version. Anyway, the latency-monitor is my own monitor testing directory, which is included in my project but it is not a podmigration component. Therefore, you can remove this directory and make run again.

mind-mind commented 3 years ago

Remove "latency-monitor" made it works now. Thank you so much.

mind-mind commented 3 years ago

Hi,

I got this

image

It seems to work until pull image. I have no idea.

Maybe should I fix my YAML file?

I tried to use your YAML file on "podmigration-operator/config/samples/migration-example" but it failed to assign to the node.

My status node seems ok

image

Here is my YAML file:

apiVersion: v1 kind: Pod metadata: name: rnn1 labels: app: custom spec: containers:

mind-mind commented 3 years ago

Also, I'm curious about something. Did you test on Ubuntu before?

https://github.com/checkpoint-restore/criu/issues/1420

I did try CRIU on podman before, it doesn't work on Ubuntu, kernel problem. I use you migrate API seems to work except for has status StartError.

Is it possible that because of the same reason? Your Demo uses Ubuntu whether or not?

vutuong commented 3 years ago
mind-mind commented 3 years ago

@vutuong,

image

I have a problem with your example YAML file either, so I might set up something wrong.

image

I think the log seems normal to me. Not sure that what I miss?

mind-mind commented 3 years ago

Here is a log of the pod

Screen Shot 2021-05-24 at 1 15 59 AM
vutuong commented 3 years ago

@vutuong,

image

I have a problem with your example YAML file either, so I might set up something wrong.

image

I think the log seems normal to me. Not sure that what I miss?

Since I not sure what is your problem since the logs is not enough for me. Check kubelet log with journalctl -fu kubelet

mind-mind commented 3 years ago

I don't mind at all, how can I reach you on K8s slack or another chat platform?

mind-mind commented 3 years ago
image image

Here is the log that you want. While waiting for your reply, I think I should try to run on Debian10.

I told you about I knew that CRIU cannot use on Ubuntu before. I think if you didn't do anything with CRIU except for integrating, possibly it shouldn't work either right?

Expectedly, you already test on Ubuntu and it works.

Ref: checkpoint-restore/criu#1420

vutuong commented 3 years ago

I don't mind as all, how can I reach you on K8s slack or another chat platform?

Please send me a mess in the k8s slack : https://app.slack.com/client/T09NY5SBT/C09NXKJKA ID: @Tuong Vu I used the ubuntu-server and it's working fine as the demo video. image

mind-mind commented 3 years ago

I don't know how to add you by ID, could you please https://join.slack.com/t/thammasatgroup/shared_invite/zt-r1n08pkw-8kT_hvLKzsylLbfLLxHOWw go to this link instead.

mind-mind commented 3 years ago

It already works. Thanks for @vutuong and @schrej

By the way, I wrote this https://gitlab.com/mindhappyokk/pod-migrating reference from you guys to set up pod migrating. It is easy to install. Hope you don't mind.

tonyliu666 commented 1 year ago

I also follow this step

image

But I got

image

I'm curious that when directory /var/lib/kubelet/migration/ was create? Thank you for your answer in advance.

Yes, sorry. This is my mistake. You should create the /var/lib/kubelet/migration/ directory at every node in the cluster first before doing step 9 with:

$ sudo mkdir /var/lib/kubelet/migration/
$ sudo chmod 777 /var/lib/kubelet/migration

Sorry will it bother you if I ask you some questions. How to connect to every node in the cluster ? For example,use ssh to get into the node.As I did is like following picture: picture But I don't know where I did something wrong. Could you give me some advices,thanks~

schrej commented 1 year ago

That's a ssh authentication issue, and not really related to this project.

How to access nodes using ssh heavily depends on how you installed them. If you didn't provide a public key that you have the private key to, it's probably not going to be possible like that. You can try this though: https://github.com/kvaps/kubectl-node-shell

120L020314 commented 8 months ago

@mind-mind i am very thankful for your guide! because the pod migration is also very importent for my thesis. and could you tell me your cluster's configuration detail? for example:your version of the ubuntu 、k8s and docker/podman ,thank you very much.