Closed haosdent closed 5 years ago
Hey, that’s how it works with kubernetes. Docker/containerd pods also may have different ip after reboot.
What do you need static ip for? You can use normal k8s services to access services on the vm.
Oh, because I would like to keep IP when ssh
Currently I use cni.projectcalico.org/ipAddrs to fix it, maybe we could record this and keep ip.
@haosdent For your safety, you should NOT rely on fixed IP address. In k8s if you need such thingy, you should use services for that behavior. So in your situation just use service for SSH. If you need external access then the desired way is to use LoadBalancer service type. They all will work with Virtlet flawlessly.
cni.projectcalico.org/ipAddrs
is obviously a way of solving it if really needed as Virtlet uses CNI :)
use services for that behavior.
I see, thx @pigmej
I use Calico CNI with virtlet, however, after I reboot the server, the IP of the server changed. How to avoid this?