<p>I have a question about Kubernetes. When auto upgrade node, related databases are wiped off.What is the reason for that ? Thank you.</p>

YMA
<p>Explanation about the issue's likely cause on <a href="https://stackoverflow.com/a/54218348/10891425">this answer</a> seems to be right. By default, the Reclaim Policy is set to <em>Delete</em>. </p>

<p>I was unable to change the setting at <em>volumeClaimTemplates.spec</em> level (I get this error: <code>unknown field "persistentVolumeReclaimPolicy" in io.k8s.api.core.v1.PersistentVolumeClaimSpec</code>).</p>

<p>What I found to be allowed is to change the Reclaim Policy on an <a href="https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/#changing-the-reclaim-policy-of-a-persistentvolume" rel="nofollow noreferrer">existing PV</a> by locating it and running:</p>

<p><code>kubectl patch pv &lt;pv-name&gt; -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}'</code></p>

<p>You could also create a new <em>StorageClass</em> with the desired <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/#the-storageclass-resource" rel="nofollow noreferrer">reclaim policy</a> for new PVs or PVCs.</p>
