Upgrade
This guide shows you how to upgrade Rhize.
Prerequisites
Before you start, ensure you have the following:
- Access to the Rhize Kubernetes Environment
- helm
- Optional: kubectx utilities
kubectx
to manage multiple clusterskubens
to switch between and configure namespaces easily
- Optional: the k8 Lens IDE, if you prefer to use Kubernetes graphically
Be sure that you notify relevant parties of the coming upgrade.
Procedure
First, record the old and new versions, their context, and namespaces.
Check the logs for the libre pods, either in Lens or with
kubectl logs
. Ensure there are no errors.Use Git to pull your Rhize customer build directory.
Change to the
kubernetes/charts/libre
directory.Check your Kubernetes context and namespace.
## context kubectl config current-context ## namespace kubectl get namespace
To change the namespace for all subsequent
kubectl
commands tolibre
, run this command:kubectl config set-context --current --namespace=libre
For a reference of useful
kubectl
commands, refer to the official kubectl Cheat Sheet.Use the
helm list
command to check for libre services.Upgrade with the following command:
helm upgrade libre -f <NAMESPACE>.yaml -n namespace
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>'
Redeploy the schema. To do so, you need to interact with the
alpha
service on port8080
. You can do this in multiple ways. Either enter the alpha shell with a command such askubectl exec --stdin baas-alpha-0 -- sh
, or forward the port to your local instance using a command such askubectl 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
.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.