Service manifests constantly updated
We are running into rate limits with our cloud provider due to dragonfly service resources constantly being updated by the dragonfly operator, even when there's no changes.
Is there any reason to update the service resource constantly even when there are no changes?
I'm also facing this. Constant reconciling from the operator logs, and service is constantly updating and reconciling in my LB when there should be no changes.
CR manifest are as below:
apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
name: my-dragonfly-1
namespace: namespace
spec:
env:
- name: DEBUG
value: "true"
tlsSecretRef:
name: my-dragonfly-1-server-tls
replicas: 4
resources:
requests:
cpu: 1
memory: 8Gi
serviceSpec:
type: LoadBalancer
annotations:
external-dns.alpha.kubernetes.io/hostname: "my-dragonfly-1.mydomain"
external-dns.alpha.kubernetes.io/ttl: "3600"
metallb.universe.tf/LoadBalancerIPs: "10.10.10.10"
authentication:
passwordFromSecret:
name: dragonflydb-1
key: password
snapshot:
persistentVolumeClaimSpec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 25Gi
storageClassName: px
cron: "0 0 * * *"
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- dragonfly
topologyKey: "kubernetes.io/hostname"
Also hitting this problem.
I also have a similar issue when using the tailscale operator. It seems like its a battle between operators. Tailscale operator wants to add a finalizer on the service and DragonflyDB operator removes it instantly creating an endless loop.
I did some digging into this. Any changes in the Service manifest will trigger a reconciliation of the Service resource and restore it to this operator desired state of the service, same goes for the statefulset. This could be a bit blocking when using in combination with other operators like in my case the tailscale operator.
I would argue(humbly with my limited knowledge) that the event added on the below line for the service is quite unnecessary.
https://github.com/dragonflydb/dragonfly-operator/blob/9874757bf4606ced0cd3bb679c2bb36b5d4f3edc/internal/controller/dragonfly_controller.go#L143
I can see the risk that something is manually or by other operators changed to break this operator but that would be quite unlikely right?
@yo-l1982 @XLordalX @sindef, here is a PR to fix it.
https://github.com/dragonflydb/dragonfly-operator/pull/339
Also hitting this problem.
https://github.com/dragonflydb/dragonfly-operator/pull/339