How to deploy elastic on k8s to avoid join validation on cluster state with a different cluster uuid error

Appreciate your insights here

Here is the sts for the master node.

apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
component: elasticsearch
role: master
name: es-master
namespace: elasticsearch
spec:
serviceName: elasticsearch-master
replicas: 3 # Number of Elasticsearch master nodes to deploy
selector:
matchLabels:
component: elasticsearch
role: master
template:
metadata:
labels:
component: elasticsearch
role: master

Could you also suggest whether by using k8s's statefulset is sufficient? Or should I even wait for one master node is fully back to form a cluster?