Upgrading KubeArchive
This document details the process to upgrade your KubeArchive installation.
|
-
Scale down KubeArchive:
kubectl scale -n kubearchive deployment -l app.kubernetes.io/part-of=kubearchive --replicas 0
-
Download the KubeArchive repository and switch to the version you would like to upgrade to.
git clone https://github.com/kubearchive/kubearchive.git --branch=v1.1.0 kubearchive-v1.1.0
-
Run the database migrations:
cd kubearchive-v1.1.0 migrate -verbose \ -path integrations/database/postgresql/migrations/ \ -database postgresql://<kubearchive-user>:<kubearchive-password>@<postgresql-host>:<postgresql-port>/<kubearchive-database> \ up
-
Apply the new KubeArchive manifests and scale up KubeArchive:
kubectl apply -n kubearchive \ -f https://github.com/kubearchive/kubearchive/releases/download/v1.1.0/kubearchive.yaml kubectl scale -n kubearchive deployment -l app.kubernetes.io/part-of=kubearchive --replicas 1
-
Check pods/deployments are running correctly:
kubectl get -n kubearchive all kubectl logs -n kubearchive deployment/kubearchive-sink kubectl logs -n kubearchive deployment/kubearchive-api-server kubectl logs -n kubearchive deployment/kubearchive-operator
Handling Upgrade Or Downgrade Failure
When a migration fails, the version of the database changes but it is left in a
state with data and/or schema inconsistencies. That stops migrate
from applying more migrations:
error: Dirty database version <VERSION>. Fix and force version.
When this happens inspect the state of the database to decide how to proceed. When you fix the problem, force the migration to the desired version with the following command (continuing the PostgreSQL example):
migrate -verbose \
-path integrations/database/postgresql/migrations/ \
-database postgresql://<kubearchive-user>:<kubearchive-password>@<postgresql-host>:<postgresql-port>/<kubearchive-database> \
force <VERSION>
The schema version for |