Elasticsearch unable to create temporary keystore

I have deployed EFK stack on Kubernetes, the EFK stack was turned off for few months in that time we changed the storage class we are using from GlusterFS to CephFS, the only thing I changed on the EFK stack is the storage class and I deleted the previous PVC it had, when I started the Statefulset for Elasticsearch I get this error

ERROR: unable to create temporary keystore at [/usr/share/elasticsearch/config/elasticsearch.keystore.tmp], write permissions required for [/usr/share/elasticsearch/config] or run [elasticsearch-keystore upgrade]

Do you know why is this happening and how can I solve it?

I tried redeploying Elastic, but I still get the same error

I am also having this same issue, when following this docs reference:

docker run -it --rm \
-v full_path_to/config:/usr/share/elasticsearch/config \
docker.elastic.co/elasticsearch/elasticsearch:8.15.2 \
bin/elasticsearch-keystore create -p

The error is here:

ERROR: unable to create temporary keystore at [/usr/share/elasticsearch/config/elasticsearch.keystore.tmp], write permissions required for [/usr/share/elasticsearch/config] or run [elasticsearch-keystore upgrade], with exit code 78