clastix / kamaji

Kamaji is the Hosted Control Plane Manager for Kubernetes.
https://kamaji.clastix.io
Apache License 2.0
1.14k stars 104 forks source link

tenantcontrolplane reconcile error: cannot build datastore storage config, schema name must either exist in Spec or Status #623

Closed sonyafenge closed 2 weeks ago

sonyafenge commented 2 weeks ago

Installed latest version: edge-24.10.1 and tried to create tenantcontroplane and got his error in kamaji-controller:

2024-10-30T17:39:32Z    ERROR    Reconciler error    {"controller": "tenantcontrolplane", "controllerGroup": "kamaji.clastix.io", "controllerKind": "TenantControlPlane", "TenantCont │
│ rolPlane": {"name":"kamaji-tc1-control-plane","namespace":"kamaji-tc1"}, "namespace": "kamaji-tc1", "name": "kamaji-tc1-control-plane", "reconcileID": "372dc589-4271-491c-8011-baa3c │
│ c33ef97", "error": "cannot build datastore storage config, schema name must either exist in Spec or Status"}                                                                          │
│ sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler                                                                                            │
│     sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:316                                                                                                  │
│ sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem                                                                                         │
│     sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:263                                                                                                  │
│ sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2                                                                                               │
│     sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:224                                                                                                  │
│ 2024-10-30T17:39:32Z    ERROR    handling of resource failed    {"controller": "tenantcontrolplane", "controllerGroup": "kamaji.clastix.io", "controllerKind": "TenantControlPlane",  │
│ "TenantControlPlane": {"name":"kamaji-tc1-control-plane","namespace":"kamaji-tc1"}, "namespace": "kamaji-tc1", "name": "kamaji-tc1-control-plane", "reconcileID": "4375f3c5-ce17-47e0 │
│ -8760-bda485a4156e", "resource": "datastore-config", "error": "cannot build datastore storage config, schema name must either exist in Spec or Status"}                               │
│ github.com/clastix/kamaji/controllers.(*TenantControlPlaneReconciler).Reconcile                                                                                                       │
│     github.com/clastix/kamaji/controllers/tenantcontrolplane_controller.go:186                                                                                                        │
│ sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Reconcile                                                                                                   │
│     sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:116                                                                                                  │
│ sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).reconcileHandler                                                                                            │
│     sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:303                                                                                                  │
│ sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).processNextWorkItem                                                                                         │
│     sigs.k8s.io/controller-runtime@v0.19.1/pkg/internal/controller/controller.go:263                                                                                                  │
│ sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller[...]).Start.func2.2

From this PR: https://github.com/clastix/kamaji/pull/554/files, DataStoreSchema should be optional

prometherion commented 2 weeks ago

I encountered the same issue, you need to update the Custom Resource Definition directly from the source, and there are several options:

I don't know which Kamaji version you're running on, but the first option should be the right one for you!

sonyafenge commented 2 weeks ago

I encountered the same issue, you need to update the Custom Resource Definition directly from the source, and there are several options:

  • kubectl apply -f https://raw.githubusercontent.com/clastix/kamaji/refs/tags/edge-24.10.1/charts/kamaji/crds/kamaji.clastix.io_tenantcontrolplanes.yaml
  • handle CRDs management with Helm by packaging the Kamaji source code
  • having a commercial subscription with CLASTIX which aligns Helm Charts, Kamaji releases, and provides best practices and upgrade paths

I don't know which Kamaji version you're running on, but the first option should be the right one for you!

I use helm to install the latest:

helm install kamaji charts/kamaji -n kamaji-system --create-namespace --set image.tag=latest

if I changed to edge-24.9.2, I don't have any problems.

prometherion commented 2 weeks ago

Even tho you're using the latest available Helm Chart which is v1.0.0, the binary edge-24.9.2 is expecting the updated CRD I pointed out in the previous comment.

The use of edge releases requires an alignment between the Operator version and the Helm chart, nothing you can't do on your own, but for testing purposes, we suggest using the latest stable version (v1.0.0).

Going to close this since it's not properly a bug, but rather a setup misconfiguration.

sonyafenge commented 2 weeks ago

Even tho you're using the latest available Helm Chart which is v1.0.0, the binary edge-24.9.2 is expecting the updated CRD I pointed out in the previous comment.

The use of edge releases requires an alignment between the Operator version and the Helm chart, nothing you can't do on your own, but for testing purposes, we suggest using the latest stable version (v1.0.0).

Going to close this since it's not properly a bug, but rather a setup misconfiguration.

I followed up this instruction and double checked it do running in edge version:

git clone https://github.com/clastix/kamaji
cd kamaji
helm install kamaji charts/kamaji -n kamaji-system --create-namespace \
    --set image.tag=latest
Containers:                                                                                                                                                     │
│   manager:                                                                                                                                                      │
│     Image:         clastix/kamaji:edge-24.10.1