I have an instance in Cluster A and another in Cluster B. My instance in Cluster A will not have it's IP changed but instances in B(which want to access instance in A) might undergo IP changes. So, how can I allow access to the instance in Cluster A without adding the IP addresses of instances in B as it is not a reliable method: whenever my instances in B restart, I will have to add the IPs again. Is VPC Peering an ideal way? How can I perform VPC Peering?
Lets say you have Pod A in Cluster A and Pod B in Cluster B and you want to access Pod B from Pod A. In this case you have a request from outside Cluster B into Cluster B and, hence, firstly you must have a Kubernetes service for Pod B and secondly you must expose it.
As you stated above you are facing the issue of dynamic IP change after restarting pods. So first make sure to create a Kubernetes Service resource for your pod which will get its own static IP/Cluster-internal DNS entry which will not change when your pod restarts. However, you must also expose this Service to be able to access it from the outside of Cluster B. There are several ways to achieve that: