6.3. Upgrading cns-deploy and Heketi Server

The following commands must be executed on the client machine.
  1. Execute the following command to update the heketi client and cns-deploy packages:

    Note

    "yum update cns-deploy -y" is not required to be executed if CNS 3.9 was deployed via Ansible.
    # yum update cns-deploy -y
    # yum update heketi-client -y
  2. Backup the Heketi database file
    # 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
  3. Execute the following steps if CNS 3.9 is deployed via cns-deploy:
    1. Execute the following command to delete the heketi template.
      # oc delete templates heketi
    2. Execute the following command to install the heketi template.
      # oc create -f /usr/share/heketi/templates/heketi-template.yaml
      template "heketi" created
    3. 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 adm policy add-scc-to-user privileged -z heketi-service-account
      For example,
      # 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
    4. Execute the following command to generate a new heketi configuration file.
      # sed -e "s/\${HEKETI_EXECUTOR}/kubernetes/" -e "s#\${HEKETI_FSTAB}#/var/lib/heketi/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
    5. Note

      If the heketi-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=heketi.json
  4. Execute the following step if CNS 3.9 is installed via Ansible:
    Depending on the OCP version, edit the heketi template to change the IMAGE_NAME, IMAGE_VERSION and CLUSTER_NAME.
    	# oc get templates
    	NAME			  DESCRIPTION		     PARAMETERS		OBJECTS
    	glusterblock-provisioner  glusterblock provisioner   3 (2 blank)	4
    				  template
    	glusterfs		  GlusterFS DaemonSet 	     5 (1 blank)	1
    				  template
    	heketi			  Heketi service deployment  7 (3 blank)	3
    				  template
    • For OCP 3.10:
      	# oc edit template heketi
      	…………………………..
      	- displayName: heketi container image name
      	  name: IMAGE_NAME
      	  required: true
      	  value: rhgs3/rhgs-volmanager-rhel7:v3.10
    • For OCP 3.9:
      	# oc edit template heketi
      	…………………………..
      	- displayName: heketi container image name
      	  name: IMAGE_NAME
      	  required: true
      	  value: rhgs3/rhgs-volmanager-rhel7
      	- displayName: heketi container image version
      	  name: IMAGE_VERSION
      	  required: true
      	  value: v3.10
  5. Execute the following command to delete the deployment configuration, service, and route for heketi:
    • For cns-deploy:
      # oc delete deploymentconfig,service,route heketi-storage
    • For Ansible:
      # oc delete deploymentconfig,service,route heketi
  6. Execute the following command to deploy the Heketi service which will be used to create persistent volumes for OpenShift:
    # oc process heketi | oc create -f -
    For example:
    # oc process heketi | oc create -f -
    
    service "heketi" created
    route "heketi" created
    deploymentconfig "heketi" created
  7. Execute the following command to verify that the containers are running:
    # oc get pods
    For example:
    # oc get pods
    NAME                             READY     STATUS    RESTARTS   AGE
    glusterfs-0h68l                  1/1       Running   0          3d
    glusterfs-0vcf3                  1/1       Running   0          3d
    glusterfs-gr9gh                  1/1       Running   0          3d
    heketi-1-zpw4d                   1/1       Running   0          3h
    storage-project-router-2-db2wl   1/1       Running   0          4d