Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create Instance resource #121

Open
stepa-ict opened this issue Jan 13, 2025 · 0 comments
Open

Unable to create Instance resource #121

stepa-ict opened this issue Jan 13, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@stepa-ict
Copy link

Hello guys,
before jumping into the problem, want to say that you're making very good staff.

Describe the bug
So I have installed the operator in the namespace "harbor" using helm:
helm install harbor-operator mittwald/harbor-operator --namespace harbor --create-namespace
I found that the resource "Instancechartrepositories" was deployed along with the operator itself.

apiVersion: registries.mittwald.de/v1alpha2 kind: InstanceChartRepository metadata: labels: app.kubernetes.io/instance: harbor-operator app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: harbor-operator app.kubernetes.io/version: v1.6.3 helm.sh/chart: harbor-operator-1.6.3 name: harbor namespace: harbor spec: name: harbor url: https://helm.goharbor.io status: state: Ready
I tried to deploy instance resource but contanlly getting error in operator logs like followings:

sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:329 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2 /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227 2025-01-13T22:06:07Z INFO controllers.registries.Instance Reconciling Instance {"instance": {"name":"test-harbor","namespace":"harbor"}} 2025-01-13T22:06:07Z INFO controllers.registries.Instance Installing Helm chart {"instance": {"name":"test-harbor","namespace":"harbor"}, "instanceName": "test-harbor"} 2025-01-13T22:06:07Z ERROR Reconciler error {"controller": "instance", "controllerGroup": "registries.mittwald.de", "controllerKind": "Instance", "Instance": {"name":"test-harbor","namespace":"harbor"}, "namespace": "harbor", "name": "test-harbor", "reconcileID": "053b5b78-0ee9-45fd-8b8d-2b13bc dfd3a0", "error": "object required"} sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:329 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266 sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2 /go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227

First, tried with this
apiVersion: registries.mittwald.de/v1alpha2 kind: Instance metadata: name: harbor-01 namespace: harbor spec: name: harbor-01 type: manual instanceURL: https://harbor.cp.telxira.io garbageCollection: cron: "0 * * * *" scheduleType: "Hourly" helmChart: release: harbor-01 chart: harbor/harbor version: v1.16.1 # equalling to Harbor OSS version v2.12.1 # see https://github.com/goharbor/harbor-helm/releases for a full list of supported versions namespace: harbor valuesYaml: ""

and after no luck tried this one:
https://github.com/mittwald/harbor-operator/blob/master/config/samples/registries_v1alpha2_instance.yaml

Also, I was thinking about adding the option to conditionally use the existing harbor instance (if there is no existing instance resource deployed in the k8s cluster.), for example taking URL and credentials from a secret existingHarbor.

Am I doing something wrong

Expected behavior
To be able to deploy harbor instance using this operator.

Kubernetes context
Kubernetes Server version: v1.30.5

@stepa-ict stepa-ict added the bug Something isn't working label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant