8.2. Upgrading your environment
- Execute the following command to update the heketi packages:
yum update heketi-templates -y yum update heketi-client -y
# yum update heketi-templates -y # yum update heketi-client -yCopy to Clipboard Copied! Toggle word wrap Toggle overflow Note
When you runyum update heketi-templates -ycommand, theheketi-templatespackage is replaced withcns-deploy. - Execute the following command to delete the old gluster template:
oc delete templates glusterfs
# oc delete templates glusterfsCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to register the new gluster template to OpenShift platform:
oc create -f /usr/share/heketi/templates/glusterfs-template.yaml
# oc create -f /usr/share/heketi/templates/glusterfs-template.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to deploy the Red Hat Gluster Storage pods:
oc process glusterfs | oc create -f - daemonset "glusterfs" created
# oc process glusterfs | oc create -f - daemonset "glusterfs" createdCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to delete the glusterfs Deploymentconfing for each gluster node:
oc delete deploymentconfig glusterfs-dc-<IP_address/Hostname>
# oc delete deploymentconfig glusterfs-dc-<IP_address/Hostname>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example,oc delete deploymentconfig glusterfs-dc-node1.example.com deploymentconfig "node1.example.com" deleted
# oc delete deploymentconfig glusterfs-dc-node1.example.com deploymentconfig "node1.example.com" deletedCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to label each node that will run Red Hat Gluster Storage pods as
glusterfs:oc label nodes <nodename> storagenode=glusterfs
# oc label nodes <nodename> storagenode=glusterfsCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example,oc label nodes node1.example.com storagenode=glusterfs node "node1.example.com" labeled
# oc label nodes node1.example.com storagenode=glusterfs node "node1.example.com" labeledCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to delete the heketi template
oc delete templates heketi
# oc delete templates heketiCopy 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 template "heketi" created
# oc create -f /usr/share/heketi/templates/heketi-template.yaml template "heketi" createdCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to create the heketi Service Account:
oc create -f /usr/share/heketi/templates/heketi-service-account.yaml serviceaccount "heketi-service-account" created
# oc create -f /usr/share/heketi/templates/heketi-service-account.yaml serviceaccount "heketi-service-account" createdCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to grant the heketi Service Account the neccessary 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-accountCopy 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-accountCopy 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 heketi oc delete route heketi oc delete service heketi
# oc delete deploymentconfig heketi # oc delete route heketi # oc delete service heketiCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to determine the mountable secret you should use for the heketi pods:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow You should select a secret that is mountable, in your project namespace, and of typekubernetes.io/service-account-token. You can use the following command to inspect a given secret:oc describe secret <secret name>
# oc describe secret <secret name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Execute the following command to deploy the Heketi service which will be used to create persistent volumes for OpenShift:
oc process heketi -v \ HEKETI_KUBE_NAMESPACE=<Project name> \ HEKETI_KUBE_APIHOST='<OpenShift master endpoint address>' \ HEKETI_KUBE_INSECURE=y \ HEKETI_KUBE_SECRETNAME=<heketi-service-account secret> | oc create -f -# oc process heketi -v \ HEKETI_KUBE_NAMESPACE=<Project name> \ HEKETI_KUBE_APIHOST='<OpenShift master endpoint address>' \ HEKETI_KUBE_INSECURE=y \ HEKETI_KUBE_SECRETNAME=<heketi-service-account secret> | oc create -f -Copy to Clipboard Copied! Toggle word wrap Toggle overflow For example: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 podsCopy to Clipboard Copied! Toggle word wrap Toggle overflow For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow