OpenEBS Version - 1.10
Usecase/STR
The current issue, The Local PV has a mapping to Node name, But the hostname is different in scale-up case, Can't change the name in existing PV.
How to attach LocalPV Device, The steps I followed in GKE and info taken from the below link
https://github.com/ranjithwingrider/solution-app/blob/master/Prometheus/day2-ops-scale-down.md
The steps I followed in GKE and info taken from the above link
You can get the device name from get bd output, Also the old hostname which it was attached, this would get changed as part attaching the disk to new node automatically.
PV would still have the old hostname as a selector.
kubectl get pv pvc-b20bd6ad-14e7-11ea-9ec3-42010a80007 -o yaml
kubectl get bd blockdevice-c6b6bbdf69d43f8c8482db796e2be1ae -n openebs -o yaml
kubectl get sts od-elasticsearch-logging-local-pv -o yaml
kubectl label node gke-gecko-elastic-search-5ba106ba-e0m4 elasticsearch=localpv
kubectl get pv pvc-b20bd6ad-14e7-11ea-9ec3-42010a80007 -o yaml > elastic_pv.yaml
````
- Attach the disk to the node and verify the BD got updated with the same.
gcloud compute instances attach-disk gke-gecko-elastic-search-5ba106ba-e0m4 --disk elasticsearch-localpv-production --device-name elasticsearch-localpv-production --zone us-central1-a
kubectl get bd blockdevice-c6b6bbdf69d43f8c8482db796e2be1ae -n openebs
- Delete the PV (Ensure you have taken the backup of PV), It wont delete, you need to remove the finalizer
kubectl delete pv pvc-b20bd6ad-14e7-11ea-9ec3-42010a80007
- Edit the PV yaml and update the hostname in this case gecko-elastic-search-5ba106ba-e0m4
Apply the same
kubectl apply -f elastic_pv.yaml
```
Boom. the Pod will be running.
Issues go stale after 90d of inactivity.
One of the ways we can solve this is using the following solution:
The above will help to set the node affinity on PV to match node label ( BD=BDC). So the Local PVs will automatically be available on the new node - instead of the current workaround where we have to delete old pv - create new one with new node affinity settings.
Thanks @bobek for the above idea!
Issues go stale after 90d of inactivity.
Most helpful comment
One of the ways we can solve this is using the following solution:
The above will help to set the node affinity on PV to match node label ( BD=BDC). So the Local PVs will automatically be available on the new node - instead of the current workaround where we have to delete old pv - create new one with new node affinity settings.
Thanks @bobek for the above idea!