Change Thanos PV Access Mode#
Note
This procedure was applied in 2020 when some Thanos were already deployed but wit a wrong access mode.
1/ Change block accessModes from ReadWriteMany to ReadWriteOnce in the configuration file
Note
The changes will affect the configuration of persistent volume claim (pvc).
2/ Change access mode to pv
This procedure apply to Thanos and Prometheus persistent volumes.
$ kubectl -n monitoring get pv # to get pv name
$ kubectl -n monitoring edit pv <pv_name> # change accessModes from `ReadWriteMany` to `ReadWriteOnce`
3/ Delete thanos-monitoring-compactor statefulset
Modifications to statefulsets are allowed, only if statefulset is deleted.
$ kubectl -n monitoring get statefulset # to get the name of the stateful set
$ kubectl -n monitoring delete statefulset <statefulset_name>
4/ Redeploy monitoring stack
Note
To see more information about the zone see Logging namespaces nomenclature on Caascad
5/ Check if pv and pvc have the same access mode
$ kubectl -n monitoring get pv, pvc # to get persistent volumes and persistent volume claim names
$ kubectl -n monitoring edit pv <pv_name>
Important
Before deployment, the pv and pvc are in mode ReadWriteMany (several nodes can attach a pv in read-write mode). After deployment, the pv and pvc are in mode ReadWriteOnce (pv can be attached in read-write mode to a single node).