<p>I have deployed a tool in the pod and need to enable port mapping on the node. But once the pod is rebuilt, the position of the pod may change and its IP will also change. Is there a corresponding resolution mechanism in k8s?</p>

Vayne
<p><a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Services</a>.</p>
<p>There are 3 options depending on how you want to expose them but the key point is that with that you maintain a single access endpoint/IP address</p>
<p>The 4 options:</p>
<ul>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types" rel="nofollow noreferrer">ClusterIP</a> - Accessible internally within the cluster.</li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/#nodeport" rel="nofollow noreferrer">NodePort</a> - A port on all your nodes where you can point your own LB to.</li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer" rel="nofollow noreferrer">LoadBalancer</a> - Ties to an infra LB like AWS ELB, GCP LB, etc.</li>
<li><a href="https://kubernetes.io/docs/concepts/services-networking/service/#externalname" rel="nofollow noreferrer">ExternalName</a> - Something outside your cluster</li>
</ul>
