How to config containerPort dynamic, for example by configMap

Cluster information:

Kubernetes version: 1.32.0
Cloud being used: (put bare-metal if not on a public cloud)
Installation method:apt-get install -y kubelet kubeadm kubectl
Host OS: Ubuntu 24.04
CNI and version:calico : 3.20.6
CRI and version: containerd:2.0.1

Hi, every one
I encountered a scene: I have a deployment that contain 3 replicas, I want every pod have it self containerPort dynamic, for example by host name etc. I need to dynamically configure containerPort, there have some solve? help me please.

Why does it need to be dynamic? Every pod has its own IP, so they can all use known ports. This is a large part of why the network model is the way it is.