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

keep vm vip when enableKeepVmIP is true #3053

Merged
merged 1 commit into from
Jul 19, 2023

Conversation

mingoooo
Copy link
Contributor

@mingoooo mingoooo commented Jul 19, 2023

What type of this PR

Examples of user facing changes:

  • Features

Which issue(s) this PR fixes:

Fixes #2954

WHAT

🤖 Generated by Copilot at 94621b0

This pull request adds a feature to reuse IP addresses for virtual machine pods and refactors the podReuseVip function. It changes the logic and location of the function in pkg/controller/vip.go and updates the function call in pkg/controller/pod.go.

🤖 Generated by Copilot at 94621b0

Sing, O Muse, of the cunning code that changed the fate of pods
That dwell in virtual machines and share the same abodes
How they learned to keep their IP, the precious podReuseVip
That moved from pod.go to another file with skill and zip

HOW

🤖 Generated by Copilot at 94621b0

  • Add support for keeping the same IP address for virtual machine pods when they are recreated (link, link, link, link)
  • Introduce a new variable isVMPod in acquireAddress in pkg/controller/pod.go to indicate whether the pod is a virtual machine pod or not (link)
  • Check the c.config.EnableKeepVmIP flag and set the isVMPod variable accordingly in acquireAddress in pkg/controller/pod.go (link)
  • Pass the isVMPod variable as an argument to the podReuseVip function, which is moved from pkg/controller/vip.go to pkg/controller/pod.go (link, link)
  • Rename the parameter isStsPod to keepVIP in the podReuseVip function to reflect the more general purpose of reusing the VIP for pods that need to keep the same IP address (link)
  • Replace the isStsPod variable with the keepVIP variable in the condition of the podReuseVip function (link)

@bobz965
Copy link
Collaborator

bobz965 commented Jul 19, 2023

hi @mingoooo thanks for your pr,could you please add some more docs about the usage

@bobz965 bobz965 merged commit 52232b5 into kubeovn:master Jul 19, 2023
@mingoooo
Copy link
Contributor Author

hi @mingoooo thanks for your pr,could you please add some more docs about the usage

sure, will do

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.

can not keep vip in vm
2 participants