Nexus version upgrade in a Kubernetes Cluster


I am running a Nexus pod which has been integrated with LDAP in a Kubernetes Cluster and it has a PVC attached to it. I have some artifacts stored in the repository. The current version i am using is 3.15 and i want to upgrade it to 3.22 version. I have created a new image with 3.22 as base and integrated the same with LDAP and want to use the new image and upgrade the same in my cluster.

The problem that iam facing is the new nexus version has the option to change the admin password at the initial load. I found a way to avoid it where in i can pass the parameter in file. Since this path in /nexus-data and it has been mounted into the pvc we are unable to avoid this pop up.

Could you please let me know if there is any way to have an upgrade done for Nexus in a kubernetes cluster which has a PVC without affecting the existing artifacts.