How to modify openshift heketi gluster block hosting volume default size from 100 to 10

This is by design that if you have not defined default size of gluster block hosting volume size during openshift cluster setup in ansible inventry file then it may further give you a lot trouble.

You may experiance error during heketi block volume provisioning in your PV claim as no space left or may be heketi server is busy.

Bellow are steps to modify the default value even if you set this in ansible during your Openshift cluster deployment.

The value actually stores as secret encoded in base64 form json file.

example gluster is 3 node and gluster project/namespace name is app-storage

# oc project app-storage
# oc get secret heketi-storage-config-secret -o yaml --export > heketi-storage-config-secret.yaml
# vi heketi-storage-config-secret.yaml

copy the encoded part in a separate file and encode it

content:-
apiVersion: v1
data:
  heketi.json: ewoJIl9wb3J0X2NvbW1lbnQiOiAiSGVrZXRpIFNlcnZlciBQb3J0IE51bWJlciIsCgkicG9ydCIgOiAiODA4MCIsCgoJIl91c2VfYXV0aCI6ICJFbmFibGUgSldUIGF1dGhvcml6YXRpb24uIFBsZWFzZSBlbmFibGUgZm9yIGRlcGxveW1lbnQiLAoJInVzZV9hdXRoIiA6IGZhbHNlLAoKCSJfand0IiA6ICJQcml2YXRlIGtleXMgZm9yIGFjY2VzcyIsCgkiand0IiA6IHsKCQkiX2FkbWluIiA6ICJBZG1pbiBoYXMgYWNjZXNzIHRvIGFsbCBBUElzIiwKCQkiYWRtaW4iIDogewoJCQkia2V5IiA6ICJNeSBTZWNyZXQiCgkJfSwKCQkiX3VzZXIiIDogIlVzZXIgb25seSBoYXMgYWNjZXNzIHRvIC92b2x1bWVzIGVuZHBvaW50IiwKCQkidXNlciIgOiB7CgkJCSJrZXkiIDogIk15IFNlY3JldCIKCQl9Cgl9LAoKCSJfZ2x1c3RlcmZzX2NvbW1lbnQiOiAiR2x1c3RlckZTIENvbmZpZ3VyYXRpb24iLAoJImdsdXN0ZXJmcyIgOiB7CgoJCSJfZXhlY3V0b3JfY29tbWVudCI6ICJFeGVjdXRlIHBsdWdpbi4gUG9zc2libGUgY2hvaWNlczogbW9jaywga3ViZXJuZXRlcywgc3NoIiwKCQkiZXhlY3V0b3IiIDogImt1YmVybmV0ZXMiLAoKCQkiX2RiX2NvbW1lbnQiOiAiRGF0YWJhc2UgZmlsZSBuYW1lIiwKCQkiZGIiIDogIi92YXIvbGliL2hla2V0aS9oZWtldGkuZGIiLAoKCQkic3NoZXhlYyIgOiB7CgkJCSJrZXlmaWxlIiA6ICIvZXRjL2hla2V0aS9wcml2YXRlX2tleSIsCgkJCSJwb3J0IiA6ICIyMiIsCgkJCSJ1c2VyIiA6ICJyb290IiwKCQkJInN1ZG8iIDogZmFsc2UKCQl9LAoKCQkiX2F1dG9fY3JlYXRlX2Jsb2NrX2hvc3Rpbmdfdm9sdW1lIjogIkNyZWF0ZXMgQmxvY2sgSG9zdGluZyB2b2x1bWVzIGF1dG9tYXRpY2FsbHkgaWYgbm90IGZvdW5kIG9yIGV4c2lzdGluZyB2b2x1bWUgZXhoYXVzdGVkIiwKCQkiYXV0b19jcmVhdGVfYmxvY2tfaG9zdGluZ192b2x1bWUiOiB0cnVlLAoKCQkiX2Jsb2NrX2hvc3Rpbmdfdm9sdW1lX3NpemUiOiAiTmV3IGJsb2NrIGhvc3Rpbmcgdm9sdW1lIHdpbGwgYmUgY3JlYXRlZCBpbiBzaXplIG1lbnRpb25lZCwgVGhpcyBpcyBjb25zaWRlcmVkIG9ubHkgaWYgYXV0by1jcmVhdGUgaXMgZW5hYmxlZC4iLAoJCSJibG9ja19ob3N0aW5nX3ZvbHVtZV9zaXplIjogMTAKCX0KfQo=
  private_key: null
kind: Secret
metadata:
  creationTimestamp: null
  name: heketi-storage-config-secret
  selfLink: /api/v1/namespaces/app-storage/secrets/heketi-storage-config-secret
type: Opaque

copy the heketi.json encoded content in a file and decode it

#  base64 -d heketi.json > heketi-decoded.json

open decoded file and find the value "block_hosting_volume_size": 100

change it from 100 to any desired value. ( dont change anything else )

now save the file and encode it again

# base64 heketi-decoded.json

# open secret file and replace old heketi.json encoded value to this new encoded base64  and save the file.

Now you can delete the secret and recreate using this secret file

# oc delete secret heketi-storage-config-secret

# oc create -f heketi-storage-config-secret.yaml

Now next and final step is to reset heketi pod do this by using oc scale

#  oc scale dc heketi-storage --replicas=0
#  oc scale dc heketi-storage --replicas=1

That's It Done !  ENjoy !

Comments

Popular posts from this blog

Running web ssh client on port 443 /80 with nginx as reverse proxy

Running cockpit behind nginx reverse proxy with nginx ssl and cockpit non ssl

Setup VOD streaming server with nginx using RTMP on Ubuntu 18.04