Elasticsearch version: 7.6.2
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"clean", BuildDate:"2020-04-16T23:34:25Z", GoVersion:"go1.14.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"15+", GitVersion:"v1.15.11-eks-065dce", GitCommit:"065dcecfcd2a91bd68a17ee0b5e895088430bd05", GitTreeState:"clean", BuildDate:"2020-07-16T01:44:47Z", GoVersion:"go1.12.17", Compiler:"gc", Platform:"linux/amd64"}
$ helm version --tls --tiller-namespace kube-system
Client: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.13.1", GitCommit:"618447cbf203d147601b4b9bd7f8c37a5d39fbb4", GitTreeState:"clean"}
I am trying to change the storageClassName from aws-ebs-st1 (HDD) to aws-ebs-gp2 (SSD) for all data nodes (note that all coordinator/master nodes are already bound to SSDs) without data loss and I think it might be possible. Here is my proposal:
- Delete the
datastatefulsetto rid thestatefulsetcontract but keep the pods (the pods will be "orphaned"):kubectl delete statefulset my-elastic-stack-data -n system-logging --cascade=false - Make a copy of the rendered helm manifest for each of the
datapods:for i in {0..11}; do; kubectl get pod my-elastic-stack-data-$i -n system-logging -oyaml > /tmp/data-$i.yaml; done - Delete the existing
data-11pod (HDD):kubectl delete pod my-elastic-stack-data-11 -n system-logging - Delete
pvcfordata-11(because the new claim name will be the same):kubectl delete pvc my-elastic-stack-data-pvc-11 -n system-logging - Wait for the remaining 11 pods (not 12, since we have deleted
data-11) to rebalance the shards among each other - Somehow create new SSD
pv(andpvc) fordata-11 - Create new
data-11pod (that will now attach to the SSDpv/pvccreated in step 6):kubectl -n system-logging apply -f /tmp/data-11.yaml - Wait for all 11 pods to rebalance the shards
- Repeat steps 3-8 for all remaining
datapods fromdata-10throughdata-0 - Re-deploy helm chart using the new
storageClassand thestatefulsetshould "adopt" the existing pods if conditions are met:
Would love some advice on this. Thanks in advance!