Is it not possible to allot a static IP address to a pod by annotating it while using minikube? I tried but it is not working for me. I followed the below documentation: https://docs.tigera.io/calico/latest/networking/ipam/use-specific-ip I think I have done everything properly as it says in the guide but its not working
I was expecting to see the ip address that I provided in annotation when doing kubectl get pods -o wide but istead, I still see the podip that was there earlier
Did you annotate your pod after it was already running, or before you started it? I found if I annotated a pod after it's already running, the IP address stayed as the original IP address until I restart/replace it.
If I annotate the pod, you can see the annotation applied BUT it still has the original IP:
Here we can see if I restart (replace) the pod, it then uses the correct, assigned IP address:
Attached a screenshot also showing that it works if I created the pod from scratch with the correct annotation: terminal output showing static ip
If you find that following these documentations (set IP pools - test networking) that minikube is not honouring any calico networking settings that you're applying to the cluster then you may have to re-start the minikube cluster with the correct CNI settings (calico doc does need an update):
I changed the block size in the custom resources:
Then applied the custom resources. Networking (Calico) worked for me correctly and I had no problem with pod static IPs.