-
Notifications
You must be signed in to change notification settings - Fork 107
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
Too many replica set are created for registry-ctl component #131
Comments
one day later, get more replicaset:
|
~$ kubectl rollout history deployment.apps/sample-harbor-registryctl
deployment.apps/sample-harbor-registryctl
REVISION CHANGE-CAUSE
1 <none>
2 <none>
3 <none>
4 <none>
5 <none>
6 <none>
7 <none>
8 <none>
9 <none>
10 <none>
11 <none>
12 <none>
13 <none>
14 <none>
15 <none>
16 <none>
17 <none>
18 <none>
19 <none>
20 <none>
21 <none>
22 <none> |
Declare the new state of the Pods by updating the PodTemplateSpec of the Deployment. A new ReplicaSet is created and the Deployment manages moving the Pods from the old ReplicaSet to the new one at a controlled rate. Each new ReplicaSet updates the revision of the Deployment. |
Get the rollout history details by command revision=1 Pod Template:
Labels:
pod-template-hash=54fc7f564
Annotations:
sample-harbor.default.registry.registryctl.goharbor.io/version: 4860044 revision=22 Pod Template:
Labels:
pod-template-hash=5fb75b98db
Annotations:
sample-harbor.default.registry.registryctl.goharbor.io/version: 5640281 |
The annotation For example, similar annotations of the core deployment:
|
It seems the |
The number of replica of registryctl is still increasing: NAME DESIRED CURRENT READY AGE
replicaset.apps/sample-harbor-core-76f967d77f 1 1 0 3d2h
replicaset.apps/sample-harbor-jobservice-6b4f89bb96 1 1 0 3d2h
replicaset.apps/sample-harbor-jobservice-79b486c54d 1 1 0 3d2h
replicaset.apps/sample-harbor-portal-bbc6c9 1 1 0 3d2h
replicaset.apps/sample-harbor-registry-688fc75c75 1 1 0 3d2h
replicaset.apps/sample-harbor-registryctl-54fc7f564 0 0 0 3d2h
replicaset.apps/sample-harbor-registryctl-5656d8d6f4 0 0 0 3d2h
replicaset.apps/sample-harbor-registryctl-5b67d698b7 1 1 0 5h35m
replicaset.apps/sample-harbor-registryctl-5fb75b98db 0 0 0 23h
replicaset.apps/sample-harbor-registryctl-5fff5cfc69 0 0 0 10h
replicaset.apps/sample-harbor-registryctl-647f499c85 0 0 0 2d7h
replicaset.apps/sample-harbor-registryctl-64b77c84fc 0 0 0 32h
replicaset.apps/sample-harbor-registryctl-64ff4599b6 0 0 0 17h
replicaset.apps/sample-harbor-registryctl-678597bc6b 0 0 0 25h
replicaset.apps/sample-harbor-registryctl-687bc446c9 0 0 0 2d3h
replicaset.apps/sample-harbor-registryctl-68dfc69756 1 1 0 6h25m
replicaset.apps/sample-harbor-registryctl-6b4965dbbc 0 0 0 21h
replicaset.apps/sample-harbor-registryctl-6b8ccdcb9 0 0 0 26h
replicaset.apps/sample-harbor-registryctl-6dbc6ff85b 0 0 0 45h
replicaset.apps/sample-harbor-registryctl-6fb4fdd49 0 0 0 3d2h
replicaset.apps/sample-harbor-registryctl-745d586f66 0 0 0 45h
replicaset.apps/sample-harbor-registryctl-75d69f5d9f 0 0 0 36h
replicaset.apps/sample-harbor-registryctl-75dd5f9b94 0 0 0 10h
replicaset.apps/sample-harbor-registryctl-76767cb449 0 0 0 10h
replicaset.apps/sample-harbor-registryctl-77485bd8 0 0 0 42h
replicaset.apps/sample-harbor-registryctl-775b7cdb86 0 0 0 26h
replicaset.apps/sample-harbor-registryctl-777cfd4b9c 0 0 0 16h
replicaset.apps/sample-harbor-registryctl-78cfc44d9 0 0 0 2d3h
replicaset.apps/sample-harbor-registryctl-7b9f4bcf86 0 0 0 35h
replicaset.apps/sample-harbor-registryctl-7bbddf4c58 0 0 0 45h
replicaset.apps/sample-harbor-registryctl-7bcdc65d99 0 0 0 42h
replicaset.apps/sample-harbor-registryctl-7bdb4f9b6 0 0 0 2d7h
replicaset.apps/sample-harbor-registryctl-7cd5b9bbd4 0 0 0 7h35m
replicaset.apps/sample-harbor-registryctl-7df56bc846 0 0 0 36h
replicaset.apps/sample-harbor-registryctl-85fd447d8b 0 0 0 14h
replicaset.apps/sample-harbor-registryctl-8666688874 0 0 0 17h
replicaset.apps/sample-harbor-registryctl-9446d65 0 0 0 31h
replicaset.apps/sample-harbor-registryctl-997d8b5b4 0 0 0 2d5h
replicaset.apps/sample-harbor-registryctl-c569ddc64 0 0 0 10h
replicaset.apps/sample-harbor-registryctl-cbb96c8bc 0 0 0 7h35m The desired pods are not successfully created: pod/sample-harbor-core-76f967d77f-vzlvq 0/1 ContainerCreating 0 3d2h
pod/sample-harbor-jobservice-6b4f89bb96-q7t77 0/1 ContainerCreating 0 3d2h
pod/sample-harbor-jobservice-79b486c54d-rb88q 0/1 ContainerCreating 0 3d2h
pod/sample-harbor-portal-bbc6c9-n7p5b 0/1 ContainerCreating 0 3d2h
pod/sample-harbor-registry-688fc75c75-wtrrh 0/1 ContainerCreating 0 3d2h
pod/sample-harbor-registryctl-5b67d698b7-xwc2x 0/1 ContainerCreating 0 5h35m
pod/sample-harbor-registryctl-68dfc69756-689lm 0/1 ContainerCreating 0 6h25m |
I see that issue on my side too |
Find some logs 2020-10-30T09:54:41.400Z ERROR controller-runtime.controller Reconciler error {"controller": "registrycontroller", "request": "default/sample-harbor", "error": "cannot set status to error: cannot set conditions to error: apply apps/v1, Kind=Deployment (default/sample-harbor-registryctl): check: cannot get apps/v1, Kind=Deployment default/sample-harbor-registryctl: Deployment.apps "sample-harbor-registryctl" not found: apply apps/v1, Kind=Deployment (default/sample-harbor-registryctl): check: cannot get apps/v1, Kind=Deployment default/sample-harbor-registryctl: Deployment.apps "sample-harbor-registryctl" not found", "errorVerbose": "Deployment.apps "sample-harbor-registryctl" not found\ncannot get apps/v1, Kind=Deployment default/sample-harbor-registryctl\ngithub.com/goharbor/harbor-operator/pkg/controller.(*Controller).ensureResourceReady\n\t/home/steven/code/harbor-operator/pkg/controller/ready.go:36\ngithub.com/goharbor/harbor-operator/pkg/controller.(*Controller).applyAndCheck\n\t/home/steven/code/harbor-operator/pkg/controller/common.go:138\ngithub.com/goharbor/harbor-operator/pkg/controller.(*Controller).ProcessFunc.func1\n\t/home/steven/code/harbor-operator/pkg/controller/resource.go:115\ngithub.com/goharbor/harbor-operator/pkg/graph.(*resourceManager).Run.func1\n\t/home/steven/code/harbor-operator/pkg/graph/runner.go:42\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/home/steven/code/harbor-operator/vendor/golang.org/x/sync/errgroup/errgroup.go:57\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1373\ncheck\ngithub.com/goharbor/harbor-operator/pkg/controller.(*Controller).applyAndCheck\n\t/home/steven/code/harbor-operator/pkg/controller/common.go:140\ngithub.com/goharbor/harbor-operator/pkg/controller.(*Controller).ProcessFunc.func1\n\t/home/steven/code/harbor-operator/pkg/controller/resource.go:115\ngithub.com/goharbor/harbor-operator/pkg/graph.(*resourceManager).Run.func1\n\t/home/steven/code/harbor-operator/pkg/graph/runner.go:42\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/home/steven/code/harbor-operator/vendor/golang.org/x/sync/errgroup/errgroup.go:57\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1373\napply apps/v1, Kind=Deployment (default/sample-harbor-registryctl)\ngithub.com/goharbor/harbor-operator/pkg/controller.(*Controller).ProcessFunc.func1\n\t/home/steven/code/harbor-operator/pkg/controller/resource.go:117\ngithub.com/goharbor/harbor-operator/pkg/graph.(*resourceManager).Run.func1\n\t/home/steven/code/harbor-operator/pkg/graph/runner.go:42\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/home/steven/code/harbor-operator/vendor/golang.org/x/sync/errgroup/errgroup.go:57\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1373\ncannot set status to error: cannot set conditions to error: apply apps/v1, Kind=Deployment (default/sample-harbor-registryctl): check: cannot get apps/v1, Kind=Deployment default/sample-harbor-registryctl: Deployment.apps "sample-harbor-registryctl" not found\ngithub.com/goharbor/harbor-operator/pkg/controller.(*Controller).HandleError\n\t/home/steven/code/harbor-operator/pkg/controller/errors.go:50\ngithub.com/goharbor/harbor-operator/pkg/controller.(*Controller).Reconcile\n\t/home/steven/code/harbor-operator/pkg/controller/common.go:121\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/home/steven/code/harbor-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:245\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/home/steven/code/harbor-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:221\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).worker\n\t/home/steven/code/harbor-operator/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:200\nk8s.io/apimachinery/pkg/util/wait.BackoffUntil.func1 |
Do u have any clue about this issue? And do you know where this annotation For rs, each label/annotation change will cause a new rs created. For the logs posted above, it seems there some outdated changes applied to |
Any progress on this issue? |
Hi Steven,
and this is the list of replicasets when I reproduced the issue:
|
Hi Steven, After more digging, I found out that the registryctl is redeployed because the registry custom ressource is modified. I also found that the resourceVersion is modified inside the registry custom ressource, but I currently don't know why yet. |
Hi Steven, We identified the root cause of the issue. The operator is watching the secret of the registry internal certificate. When the secret is created, it is created empty and then populated with the certificate. For the operator the secret exist, therefore he deploy the registry and the registryctl. When the certificate is inserted in the secret the operator detect the modification and change the resource version of the registry, which trigger a redeploy of the registryctl because the checksum of the registry have changed. I will modify the code of the operator in charge of checking if the secret exist or not. |
Any progress on this bug? |
PING! Any updates about the fix to this issue? |
Hi @steven-zou, |
* Use server side apply instead of client side apply (https://kubernetes.io/docs/reference/using-api/server-side-apply/) Remove pkg/resources/mutation package Add mandatory protocol for ports * Fix deployment check status function Add more tests deployment resource * Fix service and secret check status * Fix processFunc using dependency management * Never bypass reconciliation loop * Rename withStatus to onlySpec to ignore metadata fields * Fix JSON Marshall for all harbor apis/ Signed-off-by: Simon Guyennet <simon.guyennet@corp.ovh.com> Signed-off-by: Pierre Peronnet <pierre.peronnet@ovhcloud.com>
* Use server side apply instead of client side apply (https://kubernetes.io/docs/reference/using-api/server-side-apply/) Remove pkg/resources/mutation package Add mandatory protocol for ports * Fix deployment check status function Add more tests deployment resource * Fix service and secret check status * Fix processFunc using dependency management * Never bypass reconciliation loop * Rename withStatus to onlySpec to ignore metadata fields * Fix JSON Marshall for all harbor apis/ Signed-off-by: Simon Guyennet <simon.guyennet@corp.ovh.com> Signed-off-by: Pierre Peronnet <pierre.peronnet@ovhcloud.com>
* Use server side apply instead of client side apply (https://kubernetes.io/docs/reference/using-api/server-side-apply/) Remove pkg/resources/mutation package Add mandatory protocol for ports * Fix deployment check status function Add more tests deployment resource * Fix service and secret check status * Fix processFunc using dependency management * Never bypass reconciliation loop * Rename withStatus to onlySpec to ignore metadata fields * Fix JSON Marshall for all harbor apis/ Signed-off-by: Simon Guyennet <simon.guyennet@corp.ovh.com> Signed-off-by: Pierre Peronnet <pierre.peronnet@ovhcloud.com>
* Use server side apply instead of client side apply (https://kubernetes.io/docs/reference/using-api/server-side-apply/) Remove pkg/resources/mutation package Add mandatory protocol for ports * Fix deployment check status function Add more tests deployment resource * Fix service and secret check status * Fix processFunc using dependency management * Never bypass reconciliation loop * Rename withStatus to onlySpec to ignore metadata fields * Fix JSON Marshall for all harbor apis/ Signed-off-by: Simon Guyennet <simon.guyennet@corp.ovh.com> Signed-off-by: Pierre Peronnet <pierre.peronnet@ovhcloud.com>
* Use server side apply instead of client side apply (https://kubernetes.io/docs/reference/using-api/server-side-apply/) Remove pkg/resources/mutation package Add mandatory protocol for ports * Fix deployment check status function Add more tests deployment resource * Fix service and secret check status * Fix processFunc using dependency management * Never bypass reconciliation loop * Rename withStatus to onlySpec to ignore metadata fields * Fix JSON Marshall for all harbor apis/ Signed-off-by: Simon Guyennet <simon.guyennet@corp.ovh.com> Signed-off-by: Pierre Peronnet <pierre.peronnet@ovhcloud.com>
* Use server side apply instead of client side apply (https://kubernetes.io/docs/reference/using-api/server-side-apply/) Remove pkg/resources/mutation package Add mandatory protocol for ports * Fix deployment check status function Add more tests deployment resource * Fix service and secret check status * Fix processFunc using dependency management * Never bypass reconciliation loop * Rename withStatus to onlySpec to ignore metadata fields * Fix JSON Marshall for all harbor apis/ Signed-off-by: Simon Guyennet <simon.guyennet@corp.ovh.com> Signed-off-by: Pierre Peronnet <pierre.peronnet@ovhcloud.com>
Rework reconcilation loop. Fix #131.
Run
make sample
Then check the resource, you'll find more than one registry-ctl replica sets that with 0, 0.
Deployment is not ready:
The text was updated successfully, but these errors were encountered: