From 3e5439488b678e8827c6bcc4733f2017ed2d59fc Mon Sep 17 00:00:00 2001 From: Francesco Brunello Date: Sat, 11 Jul 2026 09:50:26 +0200 Subject: [PATCH] fix(docs): general improvements to alternative datastore guide (#1233) --- docs/content/guides/alternative-datastore.md | 211 +++++++++++++++++-- 1 file changed, 190 insertions(+), 21 deletions(-) diff --git a/docs/content/guides/alternative-datastore.md b/docs/content/guides/alternative-datastore.md index d93e170..414b124 100644 --- a/docs/content/guides/alternative-datastore.md +++ b/docs/content/guides/alternative-datastore.md @@ -17,47 +17,216 @@ The following `make` recipes help you to setup alternative `Datastore` resources ## Defining a default Datastore upon Kamaji installation -Use Helm to install the Kamaji Operator and make sure it uses a datastore with the proper driver `datastore.driver=`. -Please refer to the Chart available values for more information on supported options. +Use Helm to install the Kamaji Operator, making sure it uses a datastore with the proper driver `datastore.driver=`. Refer to the Chart's available values for more information on the supported options. -For example, with a PostgreSQL datastore installed: +The following example shows how to install PostgreSQL as the alternative default datastore for Kamaji. + + +Use the makefiles under `deploy/kine/postgresql` to deploy the proper resources (e.g. `deployment`, `certificates` and `secret`). For the sake of this example, we'll override the variable `NAME` to create the resources so they match the sample manifest used in the next step. ```bash -helm install kamaji charts/kamaji -n kamaji-system --create-namespace \ +make -C ./deploy/kine/postgresql/ postgresql NAME=gold +``` + +When all the resources are ready, apply the following sample chart: + +```bash +kubectl apply -f ./config/samples/kamaji_v1alpha1_datastore_postgresql_gold.yaml +``` + +Check the `Datastore` creation: + +```bash +kubectl get datastores +NAME DRIVER READY AGE +postgresql-gold PostgreSQL 18s +``` + +The `Datastore` stays not ready until the Kamaji chart is installed, since no operator is yet running to reconcile it. Install it with: + +```bash +helm install kamaji ./charts/kamaji -n kamaji-system --create-namespace \ --set kamaji-etcd.deploy=false \ --set datastore.driver=PostgreSQL \ - --set datastore.endpoints[0]=postgres-default-rw.kamaji-system.svc:5432 \ - --set datastore.basicAuth.usernameSecret.name=postgres-default-superuser \ - --set datastore.basicAuth.usernameSecret.namespace=kamaji-system \ + --set datastore.endpoints[0]=postgres-gold-rw.postgres-system.svc:5432 \ + --set datastore.basicAuth.usernameSecret.name=postgres-gold-superuser \ + --set datastore.basicAuth.usernameSecret.namespace=postgres-system \ --set datastore.basicAuth.usernameSecret.keyPath=username \ - --set datastore.basicAuth.passwordSecret.name=postgres-default-superuser \ - --set datastore.basicAuth.passwordSecret.namespace=kamaji-system \ + --set datastore.basicAuth.passwordSecret.name=postgres-gold-superuser \ + --set datastore.basicAuth.passwordSecret.namespace=postgres-system \ --set datastore.basicAuth.passwordSecret.keyPath=password \ - --set datastore.tlsConfig.certificateAuthority.certificate.name=postgres-default-ca \ - --set datastore.tlsConfig.certificateAuthority.certificate.namespace=kamaji-system \ + --set datastore.tlsConfig.certificateAuthority.certificate.name=postgres-gold-ca \ + --set datastore.tlsConfig.certificateAuthority.certificate.namespace=postgres-system \ --set datastore.tlsConfig.certificateAuthority.certificate.keyPath=ca.crt \ - --set datastore.tlsConfig.certificateAuthority.privateKey.name=postgres-default-ca \ - --set datastore.tlsConfig.certificateAuthority.privateKey.namespace=kamaji-system \ + --set datastore.tlsConfig.certificateAuthority.privateKey.name=postgres-gold-ca \ + --set datastore.tlsConfig.certificateAuthority.privateKey.namespace=postgres-system \ --set datastore.tlsConfig.certificateAuthority.privateKey.keyPath=ca.key \ - --set datastore.tlsConfig.clientCertificate.certificate.name=postgres-default-root-cert \ - --set datastore.tlsConfig.clientCertificate.certificate.namespace=kamaji-system \ + --set datastore.tlsConfig.clientCertificate.certificate.name=postgres-gold-root-cert \ + --set datastore.tlsConfig.clientCertificate.certificate.namespace=postgres-system \ --set datastore.tlsConfig.clientCertificate.certificate.keyPath=tls.crt \ - --set datastore.tlsConfig.clientCertificate.privateKey.name=postgres-default-root-cert \ - --set datastore.tlsConfig.clientCertificate.privateKey.namespace=kamaji-system \ + --set datastore.tlsConfig.clientCertificate.privateKey.name=postgres-gold-root-cert \ + --set datastore.tlsConfig.clientCertificate.privateKey.namespace=postgres-system \ --set datastore.tlsConfig.clientCertificate.privateKey.keyPath=tls.key ``` -Once installed, you will be able to create Tenant Control Planes using an alternative datastore. +Once the operator is fully deployed, the `Datastore` resource should appear in a `Ready` state. + +```bash +NAME DRIVER READY AGE +postgresql-gold PostgreSQL true 4m40s +``` + +Once the installation is complete, you can create Tenant Control Planes that use the alternative default datastore. + +Apply a `TenantControlPlane` manifest: + +```bash +cat > test-tenant-gold.yaml < test-tenant-gold.yaml <