Menu Close

Red Hat Training

A Red Hat training course is available for Red Hat Gluster Storage

8.2. Upgrading your environment

  1. Execute the following command to update the heketi packages:
    # yum update heketi-templates -y 
    # yum update heketi-client -y

    Note

    When you run yum update heketi-templates -y command, the heketi-templates package is replaced with cns-deploy.
  2. Execute the following command to delete the old gluster template:
    # oc delete templates glusterfs
    
  3. Execute the following command to register the new gluster template to OpenShift platform:
    # oc create -f /usr/share/heketi/templates/glusterfs-template.yaml
  4. Execute the following command to deploy the Red Hat Gluster Storage pods:
    # oc process glusterfs | oc create -f -
    daemonset "glusterfs" created
  5. Execute the following command to delete the glusterfs Deploymentconfing for each gluster node:
    # oc delete deploymentconfig  glusterfs-dc-<IP_address/Hostname>
    
    For example,
    # oc delete deploymentconfig  glusterfs-dc-node1.example.com
    deploymentconfig "node1.example.com" deleted
    
  6. Execute the following command to label each node that will run Red Hat Gluster Storage pods as glusterfs:
    # oc label nodes <nodename> storagenode=glusterfs
    For example,
    # oc label nodes node1.example.com storagenode=glusterfs
    node "node1.example.com" labeled
  7. Execute the following command to delete the heketi template
    # oc delete templates heketi
  8. Execute the following command to install the heketi template:
    # oc create -f /usr/share/heketi/templates/heketi-template.yaml
    template "heketi" created
  9. 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
  10. 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
    For example,
    # oc policy add-role-to-user edit system:serviceaccount:storage-project:heketi-service-account
  11. 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
  12. Execute the following command to determine the mountable secret you should use for the heketi pods:
    # oc describe sa heketi-service-account
    Name:                  heketi-service-account
    Namespace:             storage-project
    Labels:                none
    
    Image pull secrets:    heketi-service-account-dockercfg-jmxyz
    
    Mountable secrets:     heketi-service-account-dockercfg-jmxyz
                           heketi-service-account-token-fvhmb
    
    Tokens:                heketi-service-account-token-fvhmb
                           heketi-service-account-token-lzifj
    
    You should select a secret that is mountable, in your project namespace, and of type kubernetes.io/service-account-token . You can use the following command to inspect a given secret:
    # oc describe secret <secret name>
    
    For example:
    # oc describe secret heketi-service-account-token-fvhmb
    Name:          heketi-service-account-token-fvhmb
    Namespace:     storage-project
    Labels:        none
    Annotations:   kubernetes.io/service-account.name=heketi-service-account
                   kubernetes.io/service-account.uid=3afe5e84-c863-11e6-8736-525400556335
    Type:          kubernetes.io/service-account-token
    
    Data
    ====
    ca.crt:          1070 bytes
    namespace:       4 bytes
    service-ca.crt:  2186 bytes
    token: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJhcGxvIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6Imhla2V0aS1zZXJ2aWNlLWFjY291bnQtdG9rZW4tZnZobWIiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiaGVrZXRpLXNlcnZpY2UtYWNjb3VudCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjNhZmU1ZTg0LWM4NjMtMTFlNi04NzM2LTUyNTQwMDU1NjMzNSIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDphcGxvOmhla2V0aS1zZXJ2aWNlLWFjY291bnQifQ.OesojdalmQ9pAGR6CQ03vJizrVOGTrKYwvzVbEsms422YkJ1vFLI0idlA3Sxw3C_ZXamOEidYfD7n5A8099qjSyfbEhSZDpaYDfpH-o5gnyjNFpuBkZwPGE9KAEmStOGMtNhO-xAEtrD0UkHtDvy8JKnlrzMStP7NCfpGLL36X4qMx9exL3WGlWcth0kV0mGb3m-NWxr2w7twZK8xP-N8sMbdyD4s-N8naEBxBGAbNxufBBj6FXzzQSg5d1vIYls_ZgqbZV9Dn7fz9aB_GD9UfxI42EER8bzpobyNhxmu5GFfhX1TqE0kqfq1GR7P_Y6TuXrP2aYKPcR9ngZ56grLA
    
  13. 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 -
    For example:
    oc process heketi -v \
        HEKETI_KUBE_NAMESPACE=storage-project \
        HEKETI_KUBE_APIHOST='https://master.example.com:8443' \
        HEKETI_KUBE_INSECURE=y \
        HEKETI_KUBE_SECRETNAME=<secret from step 12 example> | oc create -f -
    
    
    service "heketi" created
    route "heketi" created
    deploymentconfig "heketi" created
  14. Execute the following command to verify that the containers are running:
    # oc get pods
    For example:
    # oc get pods
    NAME                    READY     STATUS    RESTARTS   AGE
    storage-project-router-1-pj9ea     1/1       Running   0          1d
    deploy-heketi-1-m7x8g   1/1       Running   0          1m
    glusterfs-41lfl         1/1       Running   0          1m
    glusterfs-dtyr4         1/1       Running   0          1m
    glusterfs-ral2d         1/1       Running   0          1m