OpenShift Container Storage is now OpenShift Data Foundation starting with version 4.9.
7.2. Upgrading your Independent Mode Setup
Follow the steps in the sections ahead to upgrade your independent mode Setup.
7.2.1. Upgrading the Red Hat Gluster Storage Cluster Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
To upgrade the Red Hat Gluster Storage cluster, see In-Service Software Upgrade.
7.2.2. Upgrading/Migration of Heketi in RHGS node Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Note
If Heketi is in an Openshift node, then skip this section and see Section 7.2.4.1, “Upgrading Heketi in Openshift node” instead.
Important
- In OCS 3.11, upgrade of Heketi in RHGS node is not supported. Hence, you have to migrate heketi to a new heketi pod.
- Ensure to migrate to the supported heketi deployment now, as there might not be a migration path in the future versions.
- Ensure that cns-deploy rpm is installed in the master node. This provides template files necessary to setup heketi pod.
subscription-manager repos --enable=rh-gluster-3-for-rhel-7-server-rpms
# subscription-manager repos --enable=rh-gluster-3-for-rhel-7-server-rpms
Copy to Clipboard Copied! Toggle word wrap Toggle overflow yum install cns-deploy
# yum install cns-deploy
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
- Use the newly created containerized Red Hat Gluster Storage project on the master node:
oc project <project-name>
# oc project <project-name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:oc project gluster
# oc project gluster
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command on the master node to create the service account:
oc create -f /usr/share/heketi/templates/heketi-service-account.yaml
# oc create -f /usr/share/heketi/templates/heketi-service-account.yaml serviceaccount/heketi-service-account created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command on the master node to install the heketi template:
oc create -f /usr/share/heketi/templates/heketi-template.yaml
# oc create -f /usr/share/heketi/templates/heketi-template.yaml template.template.openshift.io/heketi created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Verify if the templates are created
oc get templates
# oc get templates NAME DESCRIPTION PARAMETERS OBJECTS heketi Heketi service deployment template 5 (3 blank) 3
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command on the master node to grant the heketi Service Account the necessary privileges:
oc policy add-role-to-user edit system:serviceaccount:gluster:heketi-service-account
# oc policy add-role-to-user edit system:serviceaccount:gluster:heketi-service-account role "edit" added: "system:serviceaccount:gluster:heketi-service-account"
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc adm policy add-scc-to-user privileged -z heketi-service-account
# oc adm policy add-scc-to-user privileged -z heketi-service-account scc "privileged" added to: ["system:serviceaccount:gluster:heketi-service-account"]
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - On the RHGS node, where heketi is running, execute the following commands:
- Create the heketidbstorage volume:
heketi-cli volume create --size=2 --name=heketidbstorage
# heketi-cli volume create --size=2 --name=heketidbstorage
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Mount the volume:
mount -t glusterfs 192.168.11.192:heketidbstorage /mnt/
# mount -t glusterfs 192.168.11.192:heketidbstorage /mnt/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow where 192.168.11.192 is one of the RHGS node. - Stop the heketi service:
systemctl stop heketi
# systemctl stop heketi
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Disable the heketi service:
systemctl disable heketi
# systemctl disable heketi
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the heketi db to the heketidbstorage volume:
cp /var/lib/heketi/heketi.db /mnt/
# cp /var/lib/heketi/heketi.db /mnt/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Unmount the volume:
umount /mnt
# umount /mnt
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Copy the following files from the heketi node to the master node:
scp /etc/heketi/heketi.json topology.json /etc/heketi/heketi_key OCP_master_node:/root/
# scp /etc/heketi/heketi.json topology.json /etc/heketi/heketi_key OCP_master_node:/root/
Copy to Clipboard Copied! Toggle word wrap Toggle overflow where OCP_master_node is the hostname of the master node.
- On the master node, set the environment variables for the following three files that were copied from the heketi node. Add the following lines to ~/.bashrc file and run the bash command to apply and save the changes:
export SSH_KEYFILE=heketi_key export TOPOLOGY=topology.json export HEKETI_CONFIG=heketi.json
export SSH_KEYFILE=heketi_key export TOPOLOGY=topology.json export HEKETI_CONFIG=heketi.json
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
If you have changed the value for "keyfile" in /etc/heketi/heketi.json to a different value, change here accordingly. - Execute the following command to create a secret to hold the configuration file:
oc create secret generic heketi-config-secret --from-file=${SSH_KEYFILE} --from-file=${HEKETI_CONFIG} --from-file=${TOPOLOGY}
# oc create secret generic heketi-config-secret --from-file=${SSH_KEYFILE} --from-file=${HEKETI_CONFIG} --from-file=${TOPOLOGY} secret/heketi-config-secret created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to label the secret:
oc label --overwrite secret heketi-config-secret glusterfs=heketi-config-secret heketi=config-secret
# oc label --overwrite secret heketi-config-secret glusterfs=heketi-config-secret heketi=config-secret secret/heketi-config-secret labeled
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Get the IP addresses of all the glusterfs nodes, from the heketi-gluster-endpoints.yml file. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the above example, 192.168.11.208, 192.168.11.176, 192.168.11.192 are the glusterfs nodes. - Execute the following command to create the endpoints:
oc create -f ./heketi-gluster-endpoints.yaml
# oc create -f ./heketi-gluster-endpoints.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to create the service:
oc create -f ./heketi-gluster-service.yaml
# oc create -f ./heketi-gluster-service.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to deploy the Heketi service, route, and deployment configuration which will be used to create persistent volumes for OpenShift:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To verify if Heketi is migrated execute the following command on the master node:
oc rsh po/<heketi-pod-name>
# oc rsh po/<heketi-pod-name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:oc rsh po/heketi-1-p65c6
# oc rsh po/heketi-1-p65c6
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to check the cluster IDs
heketi-cli cluster list
# heketi-cli cluster list
Copy to Clipboard Copied! Toggle word wrap Toggle overflow From the output verify if the cluster ID matches with the old cluster.
7.2.3. Upgrading if existing version deployed using cns-deploy Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
7.2.3.1. Upgrading Heketi in Openshift node Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The following commands must be executed on the client machine.
- Execute the following command to update the heketi client and cns-deploy packages:
yum update cns-deploy -y
# yum update cns-deploy -y # yum update heketi-client -y
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Backup the Heketi database file
oc rsh <heketi_pod_name>
# oc rsh <heketi_pod_name> # cp -a /var/lib/heketi/heketi.db /var/lib/heketi/heketi.db.`date +%s`.`heketi --version | awk '{print $2}'` # exit
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to delete the heketi template.
oc delete templates heketi
# oc delete templates heketi
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to get the current HEKETI_ADMIN_KEY.The OCS admin can choose to set any phrase for user key as long as it is not used by their infrastructure. It is not used by any of the OCS default installed resources.
oc get secret heketi-storage-admin-secret -o jsonpath='{.data.key}'|base64 -d;echo
oc get secret heketi-storage-admin-secret -o jsonpath='{.data.key}'|base64 -d;echo
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to install the heketi template.
oc create -f /usr/share/heketi/templates/heketi-template.yaml
# oc create -f /usr/share/heketi/templates/heketi-template.yaml template "heketi" created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to grant the heketi Service Account the necessary privileges.
oc policy add-role-to-user edit system:serviceaccount:<project_name>:heketi-service-account
# oc policy add-role-to-user edit system:serviceaccount:<project_name>:heketi-service-account # oc adm policy add-scc-to-user privileged -z heketi-service-account
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,oc policy add-role-to-user edit system:serviceaccount:storage-project:heketi-service-account
# oc policy add-role-to-user edit system:serviceaccount:storage-project:heketi-service-account # oc adm policy add-scc-to-user privileged -z heketi-service-account
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to generate a new heketi configuration file.
sed -e "s/\${HEKETI_EXECUTOR}/ssh/" -e "s#\${HEKETI_FSTAB}#/etc/fstab#" -e "s/\${SSH_PORT}/22/" -e "s/\${SSH_USER}/root/" -e "s/\${SSH_SUDO}/false/" -e "s/\${BLOCK_HOST_CREATE}/true/" -e "s/\${BLOCK_HOST_SIZE}/500/" "/usr/share/heketi/templates/heketi.json.template" > heketi.json
# sed -e "s/\${HEKETI_EXECUTOR}/ssh/" -e "s#\${HEKETI_FSTAB}#/etc/fstab#" -e "s/\${SSH_PORT}/22/" -e "s/\${SSH_USER}/root/" -e "s/\${SSH_SUDO}/false/" -e "s/\${BLOCK_HOST_CREATE}/true/" -e "s/\${BLOCK_HOST_SIZE}/500/" "/usr/share/heketi/templates/heketi.json.template" > heketi.json
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - The
BLOCK_HOST_SIZE
parameter controls the size (in GB) of the automatically created Red Hat Gluster Storage volumes hosting the gluster-block volumes (For more information, see https://access.redhat.com/documentation/en-us/red_hat_openshift_container_storage/3.11/html-single/operations_guide/#Block_Storage). This default configuration will dynamically create block-hosting volumes of 500GB in size as more space is required. - Alternatively, copy the file
/usr/share/heketi/templates/heketi.json.template
toheketi.json
in the current directory and edit the new file directly, replacing each "${VARIABLE}
" string with the required parameter.Note
JSON formatting is strictly required (e.g. no trailing spaces, booleans in all lowercase).
Note
If theheketi-config-secret
file already exists, then delete the file and run the following command.Execute the following command to create a secret to hold the configuration file.oc create secret generic heketi-config-secret --from-file=private_key=${SSH_KEYFILE} --from-file=./heketi.json
# oc create secret generic heketi-config-secret --from-file=private_key=${SSH_KEYFILE} --from-file=./heketi.json
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to delete the deployment configuration, service, and route for heketi:
oc delete deploymentconfig,service,route heketi
# oc delete deploymentconfig,service,route heketi
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to edit the heketi template. Edit the HEKETI_USER_KEY, HEKETI_ADMIN_KEY, and HEKETI_EXECUTOR parameters.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to deploy the Heketi service, route, and deployment configuration which will be used to create persistent volumes for OpenShift:
oc process heketi | oc create -f -
# oc process heketi | oc create -f - service "heketi" created route "heketi" created deploymentconfig "heketi" created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to verify that the containers are running:
oc get pods
# oc get pods
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.2.3.2. Upgrading Gluster Block Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Execute the following steps to upgrade gluster block.
- Execute the following command to upgrade the gluster block:
yum update gluster-block
# yum update gluster-block
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Enable and start the gluster block service:
systemctl enable gluster-blockd
# systemctl enable gluster-blockd # systemctl start gluster-blockd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to update the heketi client and cns-deploy packages
yum update cns-deploy -y
# yum update cns-deploy -y # yum update heketi-client -y
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - To use gluster block, add the following two parameters to the
glusterfs
section in the heketi configuration file at /etc/heketi/heketi.JSON:auto_create_block_hosting_volume block_hosting_volume_size
auto_create_block_hosting_volume block_hosting_volume_size
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where:auto_create_block_hosting_volume
: Creates Block Hosting volumes automatically if not found or if the existing volume is exhausted. To enable this, set the value totrue
.block_hosting_volume_size
: New block hosting volume will be created in the size mentioned. This is considered only if auto_create_block_hosting_volume is set to true. Recommended size is 500G.For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the Heketi service:
systemctl restart heketi
# systemctl restart heketi
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
This step is not applicable if heketi is running as a pod in the Openshift cluster. - If a gluster-block-provisoner-pod already exists then delete it by executing the following commands:
oc delete dc <gluster-block-dc>
# oc delete dc <gluster-block-dc>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:oc delete dc glusterblock-provisioner-dc
# oc delete dc glusterblock-provisioner-dc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following commands to deploy the gluster-block provisioner:
sed -e 's/\\\${NAMESPACE}/<NAMESPACE>/' /usr/share/heketi/templates/glusterblock-provisioner.yaml | oc create -f -
# sed -e 's/\\\${NAMESPACE}/<NAMESPACE>/' /usr/share/heketi/templates/glusterblock-provisioner.yaml | oc create -f -
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc adm policy add-cluster-role-to-user glusterblock-provisioner-runner system:serviceaccount:<NAMESPACE>:glusterblock-provisioner
# oc adm policy add-cluster-role-to-user glusterblock-provisioner-runner system:serviceaccount:<NAMESPACE>:glusterblock-provisioner
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:sed -e 's/\\\${NAMESPACE}/storage-project/' /usr/share/heketi/templates/glusterblock-provisioner.yaml | oc create -f -
# sed -e 's/\\\${NAMESPACE}/storage-project/' /usr/share/heketi/templates/glusterblock-provisioner.yaml | oc create -f -
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc adm policy add-cluster-role-to-user glusterblock-provisioner-runner system:serviceaccount:storage-project:glusterblock-provisioner
# oc adm policy add-cluster-role-to-user glusterblock-provisioner-runner system:serviceaccount:storage-project:glusterblock-provisioner
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Delete the following resources from the old pod
oc delete clusterroles.authorization.openshift.io glusterblock-provisioner-runner
# oc delete clusterroles.authorization.openshift.io glusterblock-provisioner-runner
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete serviceaccounts glusterblock-registry-provisioner
# oc delete serviceaccounts glusterblock-registry-provisioner
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to create a glusterblock-provisioner.
oc process <gluster_block_provisioner_template> | oc create -f -
# oc process <gluster_block_provisioner_template> | oc create -f -
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.2.4. Upgrading if existing version deployed using Ansible Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
7.2.4.1. Upgrading Heketi in Openshift node Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
The following commands must be executed on the client machine.
- Execute the following command to update the heketi client:
yum update heketi-client -y
# yum update heketi-client -y
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Backup the Heketi database file
oc rsh <heketi_pod_name>
# oc rsh <heketi_pod_name> # cp -a /var/lib/heketi/heketi.db /var/lib/heketi/heketi.db.`date +%s`.`heketi --version | awk '{print $2}'` # exit
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to get the current HEKETI_ADMIN_KEY.The OCS admin can choose to set any phrase for user key as long as it is not used by their infrastructure. It is not used by any of the OCS default installed resources.
oc get secret heketi-storage-admin-secret -o jsonpath='{.data.key}'|base64 -d;echo
oc get secret heketi-storage-admin-secret -o jsonpath='{.data.key}'|base64 -d;echo
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following step to edit the template:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the existing template has IMAGE_NAME and IMAGE_VERSION as two parameters, then edit the template to change the HEKETI_EXECUTOR, HEKETI_FSTAB, HEKETI_ROUTE, IMAGE_NAME, IMAGE_VERSION and CLUSTER_NAME as shown in the example below.Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the template has only IMAGE_NAME, then edit the template to change the HEKETI_EXECUTOR, HEKETI_FSTAB, HEKETI_ROUTE, IMAGE_NAME, and CLUSTER_NAME as shown in the example below.Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to delete the deployment configuration, service, and route for heketi:
oc delete deploymentconfig,service,route heketi-storage
# oc delete deploymentconfig,service,route heketi-storage
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to get the current HEKETI_ADMIN_KEY.
oc get secret heketi-storage-admin-secret -o jsonpath='{.data.key}'|base64 -d;echo
oc get secret heketi-storage-admin-secret -o jsonpath='{.data.key}'|base64 -d;echo
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to deploy the Heketi service, route, and deploymentconfig which will be used to create persistent volumes for OpenShift:
oc process heketi | oc create -f -
# oc process heketi | oc create -f - service "heketi" created route "heketi" created deploymentconfig "heketi" created
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to verify that the containers are running:
oc get pods
# oc get pods
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.2.4.2. Upgrading Gluster Block if Deployed by Using Ansible Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Execute the following steps to upgrade gluster block.
- Execute the following command to upgrade the gluster block:
yum update gluster-block
# yum update gluster-block
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Enable and start the gluster block service:
systemctl enable gluster-blockd
# systemctl enable gluster-blockd # systemctl start gluster-blockd
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to update the heketi client
yum update heketi-client -y
# yum update heketi-client -y
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Restart the Heketi service:
systemctl restart heketi
# systemctl restart heketi
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Note
This step is not applicable if heketi is running as a pod in the Openshift cluster. - If a gluster-block-provisoner-pod already exists then delete it by executing the following commands:
oc delete dc <gluster-block-dc>
# oc delete dc <gluster-block-dc>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:oc delete dc glusterblock-provisioner-dc
# oc delete dc glusterblock-provisioner-dc
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the glusterblock-provisioner template to change the IMAGE_NAME, IMAGE_VERSION and NAMESPACE.
oc get templates
# oc get templates NAME DESCRIPTION PARAMETERS OBJECTS glusterblock-provisioner glusterblock provisioner template 3 (2 blank) 4 glusterfs GlusterFS DaemonSet template 5 (1 blank) 1 heketi Heketi service deployment template 7 (3 blank) 3
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the template has IMAGE_NAME and IMAGE_VERSION as two separate parameters, then update the glusterblock-provisioner template as following. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the template has only IMAGE_NAME as a parameter, then update the glusterblock-provisioner template as following. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Delete the following resources from the old pod
oc delete clusterroles.authorization.openshift.io glusterblock-provisioner-runner
# oc delete clusterroles.authorization.openshift.io glusterblock-provisioner-runner
Copy to Clipboard Copied! Toggle word wrap Toggle overflow oc delete serviceaccounts glusterblock-registry-provisioner
# oc delete serviceaccounts glusterblock-registry-provisioner
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to create a glusterblock-provisioner.
oc process <gluster_block_provisioner_template> | oc create -f -
# oc process <gluster_block_provisioner_template> | oc create -f -
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
7.2.5. Enabling S3 Compatible Object store Copy linkLink copied to clipboard!
Copy linkLink copied to clipboard!
Support for S3 compatible Object Store is under technology preview. To enable S3 compatible object store, see https://access.redhat.com/documentation/en-us/red_hat_openshift_container_storage/3.11/html-single/operations_guide/#S3_Object_Store.
Note
If you have gluster nodes and heketi pods in glusterfs registry namespace, then follow the steps in section Section 7.3, “Upgrading Gluster Nodes and heketi pods in glusterfs Registry Namespace”.