How can change master node ip address before join worker nodes

I installed kuberenetes with kubeadm according to doc also after install I did kubeadm init but did not join worker node to master node Now I need to change master node ip address but as I know kubeadm join with previous ip address and specific token also there are previous ip address in some files . How can change ip address on master node and get new token for join worker nodes to master ?

Try these steps:
Drain the node you want to change the IP address for:

kubectl drain --ignore-daemonsets

On the master node, run kubeadm init phase certs all to regenerate the certificate and key files for the control plane components with the new IP address.

Modify the Kubernetes configuration files to use the new IP address. The files you may need to modify include:
/etc/kubernetes/manifests/kube-apiserver.yaml
/etc/kubernetes/admin.conf

Restart the Kubernetes control plane components
systemctl restart kube-apiserver
systemctl restart kube-controller-manager
systemctl restart kube-scheduler

Generate a new token for the worker nodes to join the cluster:
kubeadm token create --print-join-command
This command will print the kubeadm join command with the new token and certificate key for the worker nodes to join the cluster.

On each worker node, run the kubeadm join command with the new token to join the cluster:
kubeadm join : --token --discovery-token-ca-cert-hash
You can find the new token and discovery token CA certificate hash in the output of the kubeadm token create command.

It is also recommended to consider using the services of a professional customer support company to assist with any issues or challenges during the process of changing the IP address of the Kubernetes master node and joining worker nodes to the cluster. A reliable customer support company can provide expert guidance and assistance, ensuring a smooth and successful transition.

It returns follow output on master node :

kubectl drain --ignore-daemonsets
error: USAGE: drain NODE [flags]
See ‘kubectl drain -h’ for help and examples

[root@ms ~]# systemctl restart kube-apiserver
Failed to restart kube-apiserver.service: Unit kube-apiserver.service not found.
[root@ms ~]# systemctl restart kube-controller-manager
Failed to restart kube-controller-manager.service: Unit kube-controller-manager.service not found.
[root@ms ~]# systemctl restart kube-scheduler
Failed to restart kube-scheduler.service: Unit kube-scheduler.service not found.

I could just change old ip addresses with new ip addresses in follow files :

/etc/kubernetes/manifests/kube-apiserver.yaml
/etc/kubernetes/admin.conf

Even when insert kubectl version it is showing old_ip address :

kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:“1”, Minor:“27”, GitVersion:“v1.27.1”, GitCommit:“4c9411232e10168d7b050c49a1b59f6df9d7ea4b”, GitTreeState:“clean”, BuildDate:“2023-04-14T13:21:19Z”, GoVersion:“go1.20.3”, Compiler:“gc”, Platform:“linux/amd64”}
Kustomize Version: v5.0.1
Unable to connect to the server: dial tcp old_ip address:6443: connect: no route to host

Also after get kubectl version it is showing old_ip_address instead of new ip address
kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:“1”, Minor:“27”, GitVersion:“v1.27.1”, GitCommit:“4c9411232e10168d7b050c49a1b59f6df9d7ea4b”, GitTreeState:“clean”, BuildDate:“2023-04-14T13:21:19Z”, GoVersion:“go1.20.3”, Compiler:“gc”, Platform:“linux/amd64”}
Kustomize Version: v5.0.1
Unable to connect to the server: dial tcp old_ip_address:6443: connect: no route to host