Skip to content
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

fix(operator): ipv6 support #269

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

cyrinux
Copy link
Contributor

@cyrinux cyrinux commented Dec 5, 2024

Hi,

First thanks, I was tired of redis-sentinel tilt issue. 😸

I saw a recent commit 8cc255a about ipv6 fix but turn out it was not enought. The root issue was that the label with ipv6 ip cannot be write.

This goal of this PR is to fix IPV6 support, I did it on an ipv6 only cluster. I battle all the evening, but it's now working.

This is a breaking change for now, as I have to switch from label for the masterIP to annotations as we can't store []:, so an ipv6 in label. Ipv6 or not, store the ip as annotation looks the good way to do.

I'm not sure about the "migration" process:

  • I can then add a compatibility mode keeping and testing the masterIP label, but for the next release we will need to remove it.
  • Or we just keep the code simple and bump a major with breaking change alert.

Here a sample I use:

apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
  labels:
    app.kubernetes.io/created-by: dragonfly-operator
    app.kubernetes.io/instance: dragonfly-test
    app.kubernetes.io/managed-by: kustomize
    app.kubernetes.io/name: dragonfly
    app.kubernetes.io/part-of: dragonfly-operator
  name: dragonfly-test
  namespace: default
spec:
  args:
  - '--bind=::'
  - '--admin_bind=::'
  image: docker.dragonflydb.io/dragonflydb/dragonfly:v1.25.4
  replicas: 2
  resources:
    limits:
      cpu: 600m
      memory: 384Mi
    requests:
      cpu: 500m
      memory: 256Mi

I would be happy to see this merge. Is it ok for you ?

@cyrinux cyrinux marked this pull request as draft December 5, 2024 18:59
@cyrinux cyrinux force-pushed the fix/ipv6-labels-fun branch 6 times, most recently from 716ca9a to 51e573d Compare December 5, 2024 23:03
@cyrinux cyrinux marked this pull request as ready for review December 5, 2024 23:13
@cyrinux cyrinux changed the title chore: try to workaround master label with ipv6 issue fix: ipv6 support Dec 5, 2024
@cyrinux cyrinux force-pushed the fix/ipv6-labels-fun branch 6 times, most recently from 3840eee to 26578e3 Compare December 5, 2024 23:57
@cyrinux cyrinux changed the title fix: ipv6 support fix(operator): ipv6 support Dec 6, 2024
@cyrinux cyrinux force-pushed the fix/ipv6-labels-fun branch 2 times, most recently from b6fb405 to 1e6d949 Compare December 6, 2024 00:07
@cyrinux cyrinux force-pushed the fix/ipv6-labels-fun branch from 1e6d949 to 2afc70f Compare December 6, 2024 00:08
Copy link
Collaborator

@Pothulapati Pothulapati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the work!

The masterIP label is used to match if the dragonfly replica state matches with what was configured by the Operator. There should not be any issue in moving this to an annotation (and it makes sense).

The compatibility story is important for sure, My preference would be to do them both for now i.e set as label (if ipv4 only) and annotation (for both ipv4 and ipv6) for a version and remove the label part permanently in future versions. Wdyt?

Also, You should be setting/and using the masterIP here at

if masterIp != redisMasterIp && masterIp != pod.Labels[resources.MasterIp] {

internal/controller/dragonfly_instance.go Outdated Show resolved Hide resolved
@cyrinux
Copy link
Contributor Author

cyrinux commented Dec 6, 2024

Thanks for all the work!

The masterIP label is used to match if the dragonfly replica state matches with what was configured by the Operator. There should not be any issue in moving this to an annotation (and it makes sense).

The compatibility story is important for sure, My preference would be to do them both for now i.e set as label (if ipv4 only) and annotation (for both ipv4 and ipv6) for a version and remove the label part permanently in future versions. Wdyt?

Also, You should be setting/and using the masterIP here at

if masterIp != redisMasterIp && masterIp != pod.Labels[resources.MasterIp] {

This is OK for me, I will do this :-)

@cyrinux cyrinux force-pushed the fix/ipv6-labels-fun branch from 6ece1a0 to cf485c9 Compare December 6, 2024 08:44
@cyrinux
Copy link
Contributor Author

cyrinux commented Dec 6, 2024

I'm ready for another review @Pothulapati 😃

@cyrinux cyrinux force-pushed the fix/ipv6-labels-fun branch 2 times, most recently from e9dce48 to e0a761f Compare December 6, 2024 10:06
@cyrinux cyrinux force-pushed the fix/ipv6-labels-fun branch from e0a761f to ab33a68 Compare December 6, 2024 10:08
@cyrinux cyrinux force-pushed the fix/ipv6-labels-fun branch from ab33a68 to 7516283 Compare December 6, 2024 10:10
@cyrinux
Copy link
Contributor Author

cyrinux commented Dec 6, 2024

I add another commit to bind by default on dualstack, this should not hurt.

@cyrinux cyrinux requested a review from Pothulapati December 6, 2024 10:15
@cyrinux cyrinux force-pushed the fix/ipv6-labels-fun branch 2 times, most recently from a101fd0 to c572750 Compare December 8, 2024 19:08
both operator and dragonfly, should not hurt.
@cyrinux cyrinux force-pushed the fix/ipv6-labels-fun branch from c572750 to cf69781 Compare December 8, 2024 19:12
@cyrinux
Copy link
Contributor Author

cyrinux commented Dec 11, 2024

@Pothulapati should I be worried about the CI state ? Can you please re-run it for me or have idea about what happen ? Or all is good ? 😄

For info this PR is running or my ipv6 only production since few days without issues 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants