CSI Volume Resizing and Elasticsearch

CSI Volume Expansion

kubectl patch pvc pure-claim-name -p=’{“spec”: {“resources”: {“requests”: {“storage”: “20Ti”}}}}’
$ kubectl get storageclass
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
pure-block pure-csi Delete Immediate true 53d
pure-file pure-csi Delete Immediate true 53d
> kubectl patch sc pure-file --type=json’ -p=’[{“op”: “add”, “path”: “/allowVolumeExpansion”, “value”: true }]’
> kubectl patch sc pure-block --type=’json’ -p=’[{“op”: “add”, “path”: “/allowVolumeExpansion”, “value”: true }]’

Use-case: Capacity Expansion for Elasticsearch

$ kubectl get pvc -l elasticsearch.k8s.elastic.co/cluster-name=quickstart -o name | xargs kubectl patch -p=’{“spec”: {“resources”: {“requests”: {“storage”: “200Gi”}}}}’
persistentvolumeclaim/elasticsearch-data-quickstart-es-all-nodes-0 patched
persistentvolumeclaim/elasticsearch-data-quickstart-es-all-nodes-1 patched
persistentvolumeclaim/elasticsearch-data-quickstart-es-all-nodes-2 patched
persistentvolumeclaim/elasticsearch-data-quickstart-es-all-nodes-3 patched
$ curl -XGET 'http://localhost:9200/_cat/allocation?v'shards disk.indices disk.used disk.avail disk.total disk.percent host ip node
13 8.6gb 9.5gb 483mb 10gb 95 10.233.95.19 10.233.95.19 quickstart-es-all-nodes-2
10 7.8gb 8.7gb 1.2gb 10gb 87 10.233.104.39 10.233.104.39 quickstart-es-all-nodes-0
10 3.9gb 4.2gb 801mb 5gb 84 10.233.80.112 10.233.80.112 quickstart-es-all-nodes-4
11 8.6gb 9.6gb 373.5mb 10gb 96 10.233.70.19 10.233.70.19 quickstart-es-all-nodes-1
14 8.5gb 9.4gb 550.5mb 10gb 94 10.233.94.129 10.233.94.129 quickstart-es-all-nodes-3

Experimental Validation

Approach 1: Adding nodes

Approach 2: CSI Volume Resize

kubectl get pvc -l elasticsearch.k8s.elastic.co/cluster-name=quickstart -o name | xargs kubectl patch -p=’{“spec”: {“resources”: {“requests”: {“storage”: “192Gi”}}}}’

Summary

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store