-
Notifications
You must be signed in to change notification settings - Fork 211
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
[BUG] Annotation field in zookeeper headless service does not update #474
Comments
20 tasks
hoyhbx
added a commit
to hoyhbx/zookeeper-operator
that referenced
this issue
Aug 1, 2022
hoyhbx
added a commit
to hoyhbx/zookeeper-operator
that referenced
this issue
Aug 1, 2022
hoyhbx
added a commit
to hoyhbx/zookeeper-operator
that referenced
this issue
Aug 1, 2022
Signed-off-by: hoyhbx <[email protected]>
anishakj
pushed a commit
that referenced
this issue
Aug 12, 2022
Signed-off-by: hoyhbx <[email protected]> Signed-off-by: hoyhbx <[email protected]>
mmoscher
pushed a commit
to mmoscher/zookeeper-operator
that referenced
this issue
Oct 12, 2022
Signed-off-by: hoyhbx <[email protected]> Signed-off-by: hoyhbx <[email protected]> Signed-off-by: Marco Moscher <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What did you do?
We were trying to update the field
spec.domainName
which should update an annotation (external-dns.alpha.kubernetes.io/hostname
) of thezookeeper-headless
service. However, we found that the fieldspec.domainName
only has effect when initially creating thezookeeper-headless
, and it does not correctly update theexternal-dns.alpha.kubernetes.io/hostname
annotation if thezookeeper-headless
is already present.Steps to reproduce
Install zookeeper-operator helm chart
Deploy a basic zookeeper cluster using cr1.yaml
kubectl apply -f cr1.yaml
cr1.yaml
Assign some random domain name to the field
spec.domainName
by applying cr2.yamlkubectl apply -f cr2.yaml
cr2.yaml
Observe that zookeeper-headless service is not updated with the expected annotation
external-dns.alpha.kubernetes.io/hostname
kubectl describe service zookeeper-headless
Observed zookeeper-headless
Expected zookeeper-headless
Note that the expected zookeeper-headless has the additional annotation key-value pair:
external-dns.alpha.kubernetes.io/hostname: zookeeper-headless.hgvkbmxwtg.
comparing to the observed state in the buggy run.The expected zookeeper-headless state can be corrected reached if we directly apply cr2.yaml after deploying the operator.
Did you expect to see some different?
We expected that zookeeper-operator can correctly update the zookeeper-headless service's annotation when the field
spec.domainName
is updated. Currently zookeeper-operator can only correctly create zookeeper-headless service, but cannot correctly update.Environment
Operator version (Image):
pravega/zookeeper-operator:0.2.13
Kubernetes version information:
Kubernetes cluster kind:
Root Cause
cr2.yaml
updates the fieldspec.domainName
. The field will be used in the functionmakeService
(Link) to update the annotation map inzookeeper-headless
service specification. The new service specification will be passed to the variablesvc
in zookeepercluster_controller.go#L398.In zookeepercluster_controller.go#L407, it will check whether the service
zookeeper-headless
exists or not. If not, the operator will create a newzookeeper-headless
service with the new specificationsvc
in zookeepercluster_controller.go#L411. That's why the operator can correctly create zookeeper-headless service.On the other hand, if the
zookeeper-headless
exists, the operator will use the functionzk.SyncService(foundSvc, svc)
to create a new service specification. Then, using the specificationfoundSvc
to update the existing service. However, the functionSyncService
only updatesSpec.Ports
andSpec.Type
. Hence, the operator cannot update the zookeeper-headless service correctly.To fix this bug, the function
SyncService
should be updated.Additional notes
This bug affects multiple functionalities in the CR. Including
spec.adminServerService.annotations
,spec.clientService.annotations
,spec.headlessService.annotations
.The text was updated successfully, but these errors were encountered: