Edit Page

Upgrade

This guide shows you how to upgrade Rhize.

Back up first Before upgrading, consider backing up your Rhize services. To review the procedure, read our Back up guides.

Prerequisites

Before you start, ensure you have the following:

Be sure that you notify relevant parties of the coming upgrade.

Procedure

First, record the old and new versions, their context, and namespaces.

  1. Check the logs for the libre pods, either in Lens or with kubectl logs. Ensure there are no errors.

  2. Use Git to pull your Rhize customer build directory.

  3. Change to the kubernetes/charts/libre directory.

  4. Check your Kubernetes context and namespace.

    ## context
    kubectl config current-context
    ## namespace
    kubectl get namespace
    

    To change the namespace for all subsequent kubectl commands to libre, run this command:

    kubectl config set-context --current --namespace=libre
    

    For a reference of useful kubectl commands, refer to the official kubectl Cheat Sheet.

  5. Use the helm list command to check for libre services.

  6. Upgrade with the following command:

    helm upgrade libre -f <NAMESPACE>.yaml -n namespace
    
  7. Get a token using your credentials. With curl, it looks like this:

    curl --location --request POST 'https://<AUTH_SUBDOMAIN>-<YOUR_DOMAIN>
    auth.libre/realms/libre/protocol/openid-connect/token' \
    --header 'Content-Type: application/x-www-form-urlencoded' \
    --data-urlencode 'grant_type=password' \
    --data-urlencode 'username=system@libre.com' \
    --data-urlencode 'password=<PASSWORD>' \
    --data-urlencode 'client_id=libreBaas' \
    --data-urlencode 'client_secret=<CLIENT_SECRET>'
    
  8. Redeploy the schema. To do so, you need to interact with the alpha service on port 8080. You can do this in multiple ways. Either enter the alpha shell with a command such as kubectl exec --stdin baas-alpha-0 -- sh, or forward the port to your local instance using a command such as kubectl port-forward baas-alpha-0 8080:8080.

    For example, using port forwarding, a curl command to deploy the schema looks like this:

    curl --location -X POST 'http://localhost:<FORWARDED_PORT>/admin/schema' \
    -H "Authorization: Bearer $<TOKEN>" \
    -H "content-Type: application/octet-stream" \
    --data-binary <PATH/TO/SCHEMA>.sdl
    

    The schema file is likely called something like schema.sdl.

  9. Restart the deployment.

Verify success

Verify success in Kubernetes by checking that the version upgraded properly and that the logs are correct.

Inform your team that the upgrade was successful.