goharbor / harbor-operator

Kubernetes operator for Harbor service components
Apache License 2.0
350 stars 107 forks source link

Where is the HarborProject CRD definition? #1086

Open evertdespiegeleer opened 4 months ago

evertdespiegeleer commented 4 months ago

The document "HarborProject Day2 Operations" talks about configuring and deploying Harbor projects.

Apparently, a CRD "HarborProject" (guessing harborprojects.goharbor.io) exists, which is used by the operator to manage Harbor projects. This seems great! To me, the entire point of using an operator rather than just deploying Harbor with Helm is the management of resources in Harbor.

That being said, when I deploy a HarborProject, I get an error telling me that no crd named "HarborProject" is present in my cluster. I've searched through ./manifests/harbor/deployment.yaml for both versions 1.3.0 and 1.2.0, and I indeed can't find the definition. How do I go about installing the CRD? The only CRDs installed when deploying the deployment.yaml manifest are the following:

chartmuseums
cores
exporters
harborclusters
harborconfigurations
harbors
harborserverconfigurations
jobservices
notaryservers
notarysigners
portals
pullsecretbindings
registries
registrycontrollers
trivies
ffais commented 4 months ago

You can generate all the CRDs manifest using make commands:

make dev-tools
make manifests

After that you can find all the CRDs in the harbor-operator/config/crd/bases folder.

evertdespiegeleer commented 3 months ago

Alright, I generated them myself and applied them (on release-1.3.0); That gave me these crds. Seems like I'm still missing harborprojects.

harborconfigurations.goharbor.io
harborserverconfigurations.goharbor.io
pullsecretbindings.goharbor.io
chartmuseums.goharbor.io
cores.goharbor.io
exporters.goharbor.io
harborclusters.goharbor.io
harbors.goharbor.io
jobservices.goharbor.io
notaryservers.goharbor.io
notarysigners.goharbor.io
portals.goharbor.io
registries.goharbor.io
registrycontrollers.goharbor.io
trivies.goharbor.io

For the record: I tried the make commands both on main and on release-1.3.0, but I got a whole bunch or errors on my host machine (macOS 14.3). I didn't find a dev Dockerfile or anything do I tried with golang:1.18.3, that worked :)

docker run -it --rm -v ${PWD}:/workspace golang:1.18.3 bash -c "cd /workspace && make dev-tools; make manifests"