Installation

This document explains how to install and configure KubeArchive in your Kubernetes cluster.

Prerequisites

  • A PostgreSQL instance (+v16.6) protected with TLS (can be self-signed, KubeArchive does not verify it)

  • CertManager is installed on the Kubernetes cluster (+v1.17.2)

Prepare the Database

  1. Create a user and a password for KubeArchive to use.

  2. Create a database for KubeArchive, with admin permissions granted to the new user. Configure its timezone as UTC and its locale as UTF-8.

  3. Clone the KubeArchive repository and run the SQL migrations for your database, in this example PostgreSQL:

    git clone https://github.com/kubearchive/kubearchive.git --branch=v1.9.0
    cd kubearchive
    migrate \
        -verbose -path integrations/database/postgresql/migrations/ \
        -database postgresql://:@:/ \
        up

    This configures the DB with the proper schema so KubeArchive can write and read resources.

More information about the schema and its customization in the Database Integration section.

A Kubernetes Job named kubearchive-schema-migration is installed in the kubearchive namespace. Use this as an example to build your migration automations.

Install and Configure KubeArchive

  1. Apply the release YAML to install KubeArchive:

    kubectl apply -n kubearchive -f https://github.com/kubearchive/kubearchive/releases/download/v1.9.0/kubearchive.yaml
  2. Provide the credentials for the database in the kubearchive-database-credentials secret:

    kubectl patch secret -n kubearchive kubearchive-database-credentials \
    --patch='{"stringData": {
    "DATABASE_URL": "database.example.com", (1)
    "DATABASE_PASSWORD": "password" (2)
    }}'
    1 The database URL
    2 The database password

    More info about this Secret in the Database Integration section.

  3. Restart the kubearchive-api-server and kubearchive-sink Deployments to update the database credentials secret:

    kubectl rollout -n kubearchive restart deployment kubearchive-sink kubearchive-api-server

Next steps

Continue with Accessing KubeArchive to learn how to access archived resources.