Kubernetes environment
It is highly recommended to backup and restore your system before proceeding with an upgrade.
Backup and restore
- Local
- Cloud
Local Kubernetes (K8s) environments deployed with Minikube are intended to be used for testing purposes and their data should be non-critical and easy to regenerate. However, if you want to backup the Postgres running on the K8s pod, follow the steps below.
Backup
Enter the Pod.
kubectl exec -it deployment/db -n axiomatics-asm -- bin/bash
Dump the databases.
su - postgres
cd /tmp
pg_dump asm > asm.sql
pg_dump keycloak > keycloak.sql
pg_dump domain_manager > domain_manager.sql
pg_dump pd > pd.sqlExit.
exit
exitCopy the SQL files to the host
kubectl cp axiomatics-asm/<db_pod_name>:tmp/asm.sql ./asm.sql
kubectl cp axiomatics-asm/<db_pod_name>:tmp/keycloak.sql ./keycloak.sql
kubectl cp axiomatics-asm/<db_pod_name>:tmp/domain_manager.sql ./domain_manager.sql
kubectl cp axiomatics-asm/<db_pod_name>:tmp/pd.sql ./pd.sqlImportantReplace the
<db_pod_name>
placeholders with the name of the database pod.
Restore
Stop other Pods using the database.
kubectl scale --replicas 0 deployment.apps/adm -n axiomatics-asm
kubectl scale --replicas 0 deployment.apps/asm - n axiomatics-asm
kubectl scale --replicas 0 deployment.apps/keycloak -n axiomatics-asm
kubectl scale --replicas 0 deployment.apps/pd-api -n axiomatics-asmCopy the SQL files to the database pod.
kubectl cp ./asm.sql axiomatics-asm/<db_pod_name>:tmp/asm.sql
kubectl cp ./keycloak.sql axiomatics-asm/<db_pod_name>:tmp/keycloak.sql
kubectl cp ./domain_manager.sql axiomatics-asm/<db_pod_name>:tmp/domain_manager.sql
kubectl cp ./pd.sql axiomatics-asm/<db_pod_name>:tmp/pd.sqlImportantReplace the
<db_pod_name>
placeholders with the name of the database pod.Enter the Pod.
kubectl exec -it deployment/db -n axiomatics-asm -- bin/bash
Drop the databases. Then, create them again and run the SQL files.
$ su - postgres
$ psql template1 -c 'drop database asm'
$ psql template1 -c 'drop database keycloak'
$ psql template1 -c 'drop database domain_manager'
$ psql template1 -c 'drop database pd'
$ psql template1 -c 'create database asm'
$ psql template1 -c 'create database keycloak'
$ psql template1 -c 'create database domain_manager'
$ psql template1 -c 'create database pd'
$ psql asm < asm.sql
$ psql keycloak < keycloak.sql
$ psql domain_manager < domain_manager.sql
$ psql pd < pd.sqlExit.
exit
exitStart the Pods again.
kubectl scale --replicas 1 deployment.apps/adm -n axiomatics-asm
kubectl scale --replicas 1 deployment.apps/asm -n axiomatics-asm
kubectl scale --replicas 1 deployment.apps/keycloak -n axiomatics-asm
kubectl scale --replicas 1 deployment.apps/pd-api -n axiomatics-asm
Cloud environments are using RDS Postgres which offers the option to take backups automatically. Additionally, it is possible to take DB snapshots at any time that you can export, copy, and share. Finally, you can restore a new DB from a snapshot. For more information, refer to the AWS documentation.
Upgrade
Axiomatics Services Manager 7.2 is the first version to support Kubernetes deployments. This means that there is no way to upgrade from previous versions of ASM. The steps below will guide you through the process of upgrading ASM 7.2 to the most recent available distribution of version 7.2.
The upgrade process is the same for local and cloud environments.
Download the new ASM distribution.
aws s3api get-object --bucket axiomatics-customer-artifacts --key releases/com/axiomatics/axiomatics-services-manager/axiomatics-services-manager/7.2.0-0/axiomatics-services-manager-7.2.0-0.zip axiomatics-services-manager-7.2.0-0.zip
Extract the contents of the downloaded ZIP file.
tipOptionally, if you want to build your own images, navigate to the
docker/
folder and build the images following the instructions provided here. Otherwise, continue with the next step.Navigate to the
kubernetes/
folder and add theaxiomatics_ASM.license
license file.Open the
kubernetes/asmcharts/values.yaml
file and set the appropriate configuration values that correspond to the original installation.tipAlternatively, you can skip this step and use the
--set
flag in the command below to pass directly the appropriate configuration values.Upgrade the helm charts.
helm upgrade -n axiomatics-asm asm -f asmcharts/values.yaml asmcharts