goharbor / harbor-operator

Kubernetes operator for Harbor service components
Apache License 2.0
345 stars 106 forks source link

"helm upgrade" command , wont work if Redis/PostGreSQL enabled #1006

Open ghost opened 1 year ago

ghost commented 1 year ago

HI,

Can any one help with this, error. When deploying just the operator it works fine.

But if I enable Redis/PostGreSQL/minio-operator in /harbor-operator/charts/harbor-operator/values.yaml . The harbor-operator pod keeps restating once installed, but Redis/PostGreSQL/minio look to be OK. and I get the bellow errors.

https://github.com/goharbor/harbor-operator/blob/master/docs/installation/by-helm-chart.md

I am on : Ubuntu 20.04.5 LTS. k8 v1.25.6. Make 4.2.1. Docker 20.10.16. snap 2.58.

the first part WORKS git clone https://github.com/goharbor/harbor-operator.git && \ cd harbor-operator && \ git checkout release-1.3.0 && \ vi charts/harbor-operator/values.yaml (update postgres-operator: and redis-operator: to true) make helm-generate RELEASE_VERSION=v1.3.0

But I get an Error when installing the chart helm upgrade --namespace harbor-operator-ns --install harbor-operator charts/harbor-operator-v1.3.0.tgz --set-string image.repository=ghcr.io/goharbor/harbor-operator --set-string image.tag=v1.3.0

Release "harbor-operator" does not exist. Installing it now. manifest_sorter.go:192: info: skipping unknown hook: "crd-install" manifest_sorter.go:192: info: skipping unknown hook: "crd-install" manifest_sorter.go:192: info: skipping unknown hook: "crd-install" NAME: harbor-operator LAST DEPLOYED: Wed Jan 18 12:28:13 2023

And "no file" Error in Harbor-operator pod log

k logs harbor-operator-harbor-operator-7b84d4b985-vlgvc -n harbor-operator-ns

1.6740451122623732e+09 ERROR setup.harborserverconfiguration invalid config file {"error": "stat /etc/harbor-operator/harborserverconfiguration-ctrl.yaml: no such file or directory"} 1.6740451122625978e+09 ERROR setup.exporter invalid config file {"error": "stat /etc/harbor-operator/exporter-ctrl.yaml: no such file or directory"} 1.6740451122628956e+09 ERROR setup.namespace invalid config file {"error": "stat /etc/harbor-operator/namespace-ctrl.yaml: no such file or directory"} 1.6740451122635958e+09 ERROR setup.pullsecretbinding invalid config file {"error": "stat /etc/harbor-operator/pullsecretbinding-ctrl.yaml: no such file or directory"} 1.6740451122638562e+09 ERROR setup.harborconfigurationcm invalid config file {"error": "stat /etc/harbor-operator/harborconfigurationcm-ctrl.yaml: no such file or directory"}

ghost commented 1 year ago

BUG : https://bugs.launchpad.net/charm-kubeapi-load-balancer/+bug/1893681

I have a fix/workaround. But can something be done with the chart to fix this ?

It seems harbor-operator/charts/harbor-operator/templates/crds.yaml is big. So nginx fails with an error, due to the size of the secrets generated.

Error: create: failed to create: the server responded with the status code 413 but did not return more information (post secrets)

To work around we had to ssh to kubeapi-load-balancer sudo vim /etc/nginx/sites-enabled/apilb client_max_body_size 10M;

systemctl restart nginx

It may get reset, but it gives you time to install the helm chart.